anaconda 虚拟环境使用 pyinstaller 打包 32位 exe
64 位 win10 系统,安装了 anancoda 64 位版本,用 python 写了个程序,准备使用 pyinstaller 打包为一个 exe 给别人使用,使用conda 默认的base 环境打包没有问题,但是有用户使用的是32位的windows系统,打包的64位exe无法运行,因此需要在32位环境下重新打包一份exe,于是在anaconda中创建了一个32位的虚拟环境py32,然后安装好 pyinstaller等必要包之后,开始打包,结果提示:
(py32) C:\Users\...\iHerbarium>pyinstaller iHerbarium.py125 INFO: PyInstaller: 3.5
125 INFO: Python: 3.7.5
140 INFO: Platform: Windows-10-10.0.18362-SP0
140 INFO: wrote C:\Users\...\iHerbarium.spec
140 INFO: UPX is not available.
140 INFO: Extending PYTHONPATH with paths
['C:\\Users\\...\\iHerbarium',
'C:\\Users\\...\\iHerbarium']
140 INFO: checking Analysis
140 INFO: Building Analysis because Analysis-00.toc is non existent
140 INFO: Initializing module dependency graph...
156 INFO: Initializing module graph hooks...
156 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Users\...\Anaconda3\envs\py32\lib\pkgutil.py", line 3, in <module>
from collections import namedtuple
File "C:\Users\...\Anaconda3\envs\py32\lib\collections\__init__.py", line 27, in <module>
from reprlib import recursive_repr as _recursive_repr
File "C:\Users\...\Anaconda3\envs\py32\lib\site-packages\reprlib\__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Users\...\Anaconda3\envs\py32\lib\pkgutil.py", line 3, in <module>
from collections import namedtuple
File "C:\Users\...\Anaconda3\envs\py32\lib\collections\__init__.py", line 27, in <module>
from reprlib import recursive_repr as _recursive_repr
File "C:\Users\...\Anaconda3\envs\py32\lib\site-packages\reprlib\__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
4939 INFO: running Analysis Analysis-00.toc
4939 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by C:\Users\...\Anaconda3\envs\py32\python.exe
5486 INFO: Caching module hooks...
5501 INFO: Analyzing C:\Users\...\iHerbarium\iHerbarium.py
5907 INFO: Processing pre-find module path hook distutils
8689 INFO: Processing pre-safe import module hook setuptools.extern.six.moves
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "C:\Users\...\Anaconda3\envs\py32\lib\site-packages\setuptools\__init__.py", line 5, in <module>
import functools
File "C:\Users\...\Anaconda3\envs\py32\lib\functools.py", line 21, in <module>
from collections import namedtuple
File "C:\Users\...\Anaconda3\envs\py32\lib\collections\__init__.py", line 27, in <module>
from reprlib import recursive_repr as _recursive_repr
File "C:\Users\...\Anaconda3\envs\py32\lib\site-packages\reprlib\__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 5, in <module>
File "C:\Users\...\Anaconda3\envs\py32\lib\site-packages\setuptools\__init__.py", line 5, in <module>
import functools
File "C:\Users\...\Anaconda3\envs\py32\lib\functools.py", line 21, in <module>
from collections import namedtuple
File "C:\Users\...\Anaconda3\envs\py32\lib\collections\__init__.py", line 27, in <module>
from reprlib import recursive_repr as _recursive_repr
File "C:\Users\...\Anaconda3\envs\py32\lib\site-packages\reprlib\__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
pre-safe-import-module hook failed, needs fixing.
以上是 anaconda 虚拟环境使用 pyinstaller 打包 32位 exe 的全部内容, 来源链接: utcz.com/p/937724.html