在 Windows 上安装 pipenv 失败
Installation of pipenv on Windows fails
我正在使用 Django Heroku 模板开发网站。我想在我的 Windows 计算机上处理这个网站,使用 Heroku 和 Python 的要求之一是拥有 pipenv(该项目有一个 Pipfile)。
要在 Windows 上安装 pipenv,我在 cmd 终端中尝试了两个命令,给出了大致相同的错误:
pip install pipenv
结果
Collecting pipenv
Using cached pipenv-11.9.0.tar.gz
Complete output from command python setup.py egg_info:
error in pipenv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in pathlib;python_version<"3.4" at ;python_version<"3.4"
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\myUserName\AppData\Local\Temp\pip-build-267yrlop\pipenv\
并且:
easy_install -U pipenv
结果
Searching for pipenv
Reading https://pypi.python.org/simple/pipenv/
Best match: pipenv 11.9.0
Downloading https://pypi.python.org/packages/aa/43/e7426676c659fa3c1db28653ceee3571efbaaec2d2795bca00212989268a/pipenv-11.9.0.tar.gz#md5=0cdefd8434dc2b30415708d517730dcb
Processing pipenv-11.9.0.tar.gz
Writing C:\Users\myUserName\AppData\Local\Temp\easy_install-p2bvwljy\pipenv-11.9.0\setup.cfg
Running pipenv-11.9.0\setup.py -q bdist_egg --dist-dir C:\Users\myUserName\AppData\Local\Temp\easy_install-p2bvwljy\pipenv-11.9.0\egg-dist-tmp-vfore9pv
error: Setup script exited with error in pipenv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in pathlib;python_version<"3.4" at ;python_version<"3.4"
我不太明白错误信息。这似乎是 pipenv 的设置脚本中的错误,但很可能不是。还是期望 Python 版本低于 3.4? (如果是这样,我如何使用我的 Python 3.5 安装它?)
编辑:我尝试过在 virtualenv 内外使用管理员权限,但结果相同。
来自 here
On Windows you can find the user base binary directory by running py
-m site --user-site and replacing site-packages with Scripts. For example, this could return
C:\Users\Username\AppData\Roaming\Python36\site-packages so you would
need to set your PATH to include
C:\Users\Username\AppData\Roaming\Python36\Scripts. You can set your
user PATH permanently in the Control Panel. You may need to log out
for the PATH changes to take effect.
我无法在机器上制作它,但如果可能的话,请使用 anaconda 它有很多库 pre-installed
我认为这与 setuptools 或 pip 的过时版本有关。首先尝试使用
更新设置工具
pip install --upgrade setuptools
然后使用
安装 pipenv
pip install pipenv
如果仍然失败,请尝试使用
更新您的 pip 版本
pip install --upgrade pip
或(因为你提到你在 Windows)
python -m pip install --upgrade pip
试试这个
#pip install --user pipenv
我正在使用 Django Heroku 模板开发网站。我想在我的 Windows 计算机上处理这个网站,使用 Heroku 和 Python 的要求之一是拥有 pipenv(该项目有一个 Pipfile)。
要在 Windows 上安装 pipenv,我在 cmd 终端中尝试了两个命令,给出了大致相同的错误:
pip install pipenv
结果
Collecting pipenv
Using cached pipenv-11.9.0.tar.gz
Complete output from command python setup.py egg_info:
error in pipenv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in pathlib;python_version<"3.4" at ;python_version<"3.4"
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\myUserName\AppData\Local\Temp\pip-build-267yrlop\pipenv\
并且:
easy_install -U pipenv
结果
Searching for pipenv
Reading https://pypi.python.org/simple/pipenv/
Best match: pipenv 11.9.0
Downloading https://pypi.python.org/packages/aa/43/e7426676c659fa3c1db28653ceee3571efbaaec2d2795bca00212989268a/pipenv-11.9.0.tar.gz#md5=0cdefd8434dc2b30415708d517730dcb
Processing pipenv-11.9.0.tar.gz
Writing C:\Users\myUserName\AppData\Local\Temp\easy_install-p2bvwljy\pipenv-11.9.0\setup.cfg
Running pipenv-11.9.0\setup.py -q bdist_egg --dist-dir C:\Users\myUserName\AppData\Local\Temp\easy_install-p2bvwljy\pipenv-11.9.0\egg-dist-tmp-vfore9pv
error: Setup script exited with error in pipenv setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in pathlib;python_version<"3.4" at ;python_version<"3.4"
我不太明白错误信息。这似乎是 pipenv 的设置脚本中的错误,但很可能不是。还是期望 Python 版本低于 3.4? (如果是这样,我如何使用我的 Python 3.5 安装它?)
编辑:我尝试过在 virtualenv 内外使用管理员权限,但结果相同。
来自 here
On Windows you can find the user base binary directory by running py -m site --user-site and replacing site-packages with Scripts. For example, this could return C:\Users\Username\AppData\Roaming\Python36\site-packages so you would need to set your PATH to include C:\Users\Username\AppData\Roaming\Python36\Scripts. You can set your user PATH permanently in the Control Panel. You may need to log out for the PATH changes to take effect.
我无法在机器上制作它,但如果可能的话,请使用 anaconda 它有很多库 pre-installed
我认为这与 setuptools 或 pip 的过时版本有关。首先尝试使用
更新设置工具pip install --upgrade setuptools
然后使用
安装 pipenvpip install pipenv
如果仍然失败,请尝试使用
更新您的 pip 版本pip install --upgrade pip
或(因为你提到你在 Windows)
python -m pip install --upgrade pip
试试这个
#pip install --user pipenv