2017-08-29 81 views
0

安装pyinstaller我使用Python 3.6.0无法使用PIP

python --version 
Python 3.6.0 

我试图使用PIP到自定义文件夹中安装pyinstaller

pip install pyinstaller --target=/prj/qc-tools/lib/pyinstaller 
Collecting pyinstaller 
Collecting setuptools (from pyinstaller) 
    Using cached setuptools-36.3.0-py2.py3-none-any.whl 
Installing collected packages: setuptools, pyinstaller 
Successfully installed pyinstaller-3.2.1 setuptools-36.3.0 

的文件夹没有一个pyinstaller.py在里面。

ls 
easy_install.py pkg_resources __pycache__ PyInstaller PyInstaller-3.2.1.dist-info setuptools setuptools-36.3.0.dist-info 

关于pyinstaller.org的文档没有多说什么。我该怎么办?

+0

为什么你认为首先应该用'pyinstaller.py'?尝试从python控制台导入PyInstaller,它工作吗? – 9dogs

+0

我认为pyinstaller.py应该存在的原因是因为pyinstaller.org这样说 - 相当于pyinstaller命令是pyinstaller-folder/pyinstaller.py。是的,我可以从控制台导入PyInstaller,但我该如何使用它?如何将python脚本转换为使用它的独立可执行文件? – shikhanshu

+1

似乎使用'--target'可以防止pip创建输入脚本。有关详细信息,请参阅[此答案](https://stackoverflow.com/a/29103053/5827010)。无论如何,[pyinstaller.py'的内容是微不足道的](https://github.com/pyinstaller/pyinstaller/blob/develop/pyinstaller.py) – 9dogs

回答

1

pip代表python2,pip3代表python3。你应该安装pip3并尝试命令pip3 install pyinstaller --target=/prj/qc-tools/lib/pyinstaller

+0

否。在我的安装中,pip是pip3的符号链接。无论如何,我尝试过pip和pip3,并且遇到同样的问题。 – shikhanshu

0

我结束了不使用pip安装。我从pypi下载了tarball,只是提取了内容,我可以直接使用pyinstaller.py将我的脚本转换为可执行文件。