python Building wheel for future (setup.py) ... error

pip install pyinstaller 时报如下错误:

Collecting future
  Using cached future-0.18.2.tar.gz (829 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: future
  Building wheel for future (setup.py) ... error
  ERROR: Command errored out with exit status 1:

   command: 'D:\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:....省略

核心的问题错误就是涂红色这两行,就是说building wheel for future 时错误了,找了很多贴子,都是手动下载whl 然后在安装的,其实在我测试手动下载后安装也会报错,不过报的错误是

creating dist
creating 'dist\future-0.18.2-py3.10.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing future-0.18.2-py3.10.egg
removing 'd:\python310\lib\site-packages\future-0.18.2-py3.10.egg' (and everything under it)
creating d:\python310\lib\site-packages\future-0.18.2-py3.10.egg
Extracting future-0.18.2-py3.10.egg to d:\python310\lib\site-packages
Adding future 0.18.2 to easy-install.pth file
error: [Errno 22] Invalid argument: 'd:\\python310\\lib\\site-packages\\easy-install.pth'

最后这一行报无效的参数,其实安装过程还是成果了,接最后没有写到easy-install.pth中,猜想如果没有写进去,其它程序调用easy-install 时同样还出错,好像是pip调用的就是easy-install.

既然你没有写进去,是不是可以手动写进去了?

查看'd:\\python310\\lib\\site-packages\\easy-install.pth'文件

python Building wheel for future (setup.py) ... error_第1张图片

 果然没有future文件,参考如上这个格式,把它手动添加进去

log可以看到它的egg

python Building wheel for future (setup.py) ... error_第2张图片

 修改完如下;python Building wheel for future (setup.py) ... error_第3张图片

 再安装 pip install future,果然显示已经安装成果了

 此时再pip install pyinstaller (install 其它包同样会有这问题,简单的不依耐future和pefile的能正常安装)很快就成功了。

python Building wheel for future (setup.py) ... error_第4张图片

 反向测试,去掉手动修改的easy-install.pth部分

又报错

python Building wheel for future (setup.py) ... error_第5张图片

 最开始以为python cmd才有这问题,在pycham里安装同样会报错

Collecting pyinstaller
  Using cached pyinstaller-4.7-py3-none-win_amd64.whl (2.0 MB)
Collecting altgraph
  Using cached altgraph-0.17.2-py2.py3-none-any.whl (21 kB)
Collecting pywin32-ctypes>=0.2.0
  Using cached pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)
Collecting pyinstaller-hooks-contrib>=2020.6
  Using cached pyinstaller_hooks_contrib-2021.3-py2.py3-none-any.whl (200 kB)
Requirement already satisfied: pefile>=2017.8.1 in d:\python310\lib\site-packages\pefile-2021.9.3-py3.10.egg (from pyinstaller) (2021.9.3)
Requirement already satisfied: setuptools in d:\python310\lib\site-packages (from pyinstaller) (59.3.0)
Collecting future
  Using cached future-0.18.2.tar.gz (829 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: future
  Building wheel for future (setup.py): started
  Building wheel for future (setup.py): finished with status 'error'
  Running setup.py clean for future
Failed to build future
Installing collected packages: future, pywin32-ctypes, pyinstaller-hooks-contrib, altgraph, pyinstaller
    Running setup.py install for future: started
    Running setup.py install for future: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'D:\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] 

总结:整个pyinstaller 不能安装成功的原因是缺少future库的支持,而手动安装future库最后也报错,没有写入到easy-install.pth文件中

        因此打破链路的重点就是手动加入到easy-install中。

此时无论在cmd使用pip安装还是使用pycham安装都不会错。

就这么简单的问题,折腾了一下午,好久没用python,想再用用,结果出错,重新安装版本,重启电脑,更新pip,wheel,手动下载然后用setup安装都试过了!

吃一暂长一智,希望后面的同学能参考,不要总是手动去安装了,pip还是方便很多。

虽然如上安装pyinstaller是成功了,但使用起来又出错。

python Building wheel for future (setup.py) ... error_第6张图片

 查了好久,最有可能的还是文件访问权限问题,

windows - Python Pyinstaller ERRNO 22 Invalid Argument - Stack Overflow

python Building wheel for future (setup.py) ... error_第7张图片

 因为杀毒软件是公司后台装的,设置也不能添加列外,只能用另一台电脑使用pyinstaller了。

总结:1.我这种情况不能装成功Pyinstaller,是因为不能在easy_install 文件中写入.egg文件(文件不能程序写入)

使用pyinstaller _F xxx 时报OSerror,也大概率是不能访问文件(未得到验证,但别人的贴子是得到了验证)

 

你可能感兴趣的:(Python,三极管,三极管开关,python)