[PyInstaller] ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

2020-04-21 Thread ttepperg
Hi Guys,

I just updated my python 3.6 version to a more recent one, and suddenly I 
get the error:

ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

when running a Mac App.

>From what I could find. apparently the problem is related to the version of
setuptools (was 45 before, is 46 now). According to the discussion here:

https://github.com/pypa/setuptools/issues/1963

A workaround is to compile the code with the flag:

hidden-import='pkg_resources.py2_warn'

And it actually works. However, I find this to be just an ugly solution and 
I was wondering
whether there is another way to solve this problem?

Cheers,

Thor.

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/b5a980ac-6053-4068-8d2a-1ec00d4cd896%40googlegroups.com.


[PyInstaller] Re: Pyinstaller cannot access a particular file

2020-04-21 Thread Jamison Morse
Hello Michael --

Have you found the solution to your issue? I am having the exact same issue 
and cannot figure out how to correct.

My info for the versions I am using is below:
408 INFO: PyInstaller: 3.6
409 INFO: Python: 3.8.2
409 INFO: Platform: Windows-10-10.0.18362-SP0

I get the same info:

line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', 'The file 
cannot be accessed by the system')


Any help would be appreciated. Thanks!

Jamison

On Tuesday, November 19, 2019 at 4:39:26 AM UTC-5, Michael wrote:
>
> Hi there. I am having trouble with this file:
>
>
> "C:\Users\Michael\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\win32ctypes\pywin32\pywintypes.py"
>
>
> Powershell says:
>
>
> line 37, in pywin32error
> raise error(exception.winerror, exception.function, exception.strerror)
> win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryExW', 'The file 
> cannot be accessed by the system.')
>
>
> I have tried running powershell as admin and also adding the entire 
> directory to PATH but it still refuses to work. Any help greatly 
> appreciated. 
>
> Regards, Michael
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/1a9257cb-caeb-407a-b131-c9285734abbb%40googlegroups.com.


[PyInstaller] Re: ModuleNotFoundError: No module named 'pkg_resources.py2_warn'

2020-04-21 Thread bwoodsend
There are a couple of others.

One is to put the following somewhere in your code:
import pkg_resources.py2_warn
Or to make it work as well with older setuptools versions:
try:
import pkg_resources.py2_warn
except ImportError:
pass

A more satisfactory solution would be to use PyInstaller's hooks which tell 
PyInstaller contain the hidden-import='pkg_resources.py2_warn' information. 
The hook for pkg_resources has been updated on github 

 
but the changes haven't been released yet. You could upgrade to the 
developer version on Github or you could manually update that file in your 
own installation.

Alternatively you can download that hook file and put it somewhere 
PyInstaller can find it (usually next to your main script).

Brénainn

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/39fde230-b31e-4c7b-ad56-0509da6dbca5%40googlegroups.com.


[PyInstaller] Re: Compiling using pyinstaller external pythonpath that is in another program module

2020-04-21 Thread António Alexandre Fraga Dias
First thank you.

I think i have done it correctly, the adding of the path that you 
suggested. You can see the file.



# -*- mode: python ; coding: utf-8 -*-


block_cipher = None




a = Analysis(['PC.py'],
 pathex=['D:\\Python\\Novo\\Point Cloud Ver2','C:\\Program 
Files\\CARIS\\BASE Editor\\5.3\\python\\3.5'],
 binaries=[],
 datas=[('ReadAPointCloudFromAPLYFileExample_01.png', '.')],
 hiddenimports=[],
 hookspath=[],
 runtime_hooks=[],
 excludes=['caris'],
 win_no_prefer_redirects=False,
 win_private_assemblies=False,
 cipher=block_cipher,
 noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
 cipher=block_cipher)
exe = EXE(pyz,
  a.scripts,
  [('v', None, 'OPTION')],
  exclude_binaries=True,
  name='Point Cloud',
  debug=False,
  bootloader_ignore_signals=False,
  strip=False,
  upx=True,
  console=True , icon='Point_Cloud.ico')
coll = COLLECT(exe,
   a.binaries,
   a.zipfiles,
   a.datas,
   strip=False,
   upx=True,
   upx_exclude=[],
   name='Point Cloud')


After running it the result was the same. I have to had that the 
path C:\\Program Files\\CARIS\\BASE Editor\\5.3\\python\\3.5 is a variable 
path since it corresponds to the install directory and I retrieve it using 
a class.
In a way i have also to refer that the caris module has DLL hidden in the 
pyd, do not know if this is the reason for having this error. It's clear 
when running without the 
--exclude-module=caris

command.

If i do it i get the DLL list that pyinstaller sees but does not finds it. 
Any ideas? 


terça-feira, 21 de Abril de 2020 às 00:02:54 UTC+2, bwoodsend escreveu:
>
> I take it you are putting the sys.path.insert in your PC.py? In which 
> case that isn't enough for PyInstaller to find and bundle it properly.
>
> I believe you can't do this using the command line. Run your bat file 
> once. It should create a file called *PC.spec*. In it is all the 
> information you would normally pass via command line arguments. To build 
> you can just call
> PyInstaller PC.spec
> rather than running your bat file in future.
>
> Now to modify the build you should modify the spec file. In your spec 
> there should be an argument `pathex=["folder/containing/your/script"]`. Add 
> "C:/Program Files/CARIS/BASE Editor/5.3/python/3.5/" to that list noting 
> the use of /s rather than \s in the path.
>
> That should do it.
>
> Brénainn
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/55520d2c-2428-4db0-aed7-297e6706bafb%40googlegroups.com.