Running --upgrade with pipenv

萝らか妹 提交于 2019-12-23 07:30:06

问题


Running (say for numpy) pipenv install --upgrade numpy tries to install --upgrade and numpy instead of normal pip behavior for --upgrade switch.Is anyone else having this problem?


回答1:


For pipenv use update command , not --upgrade switch. You can update a package with:

pipenv update numpy 

See comments in documentation.

This will also persist new version of package in Pipfile/Pipfile.lock, no manual editing needed. There was a bug with this command under certain scenarios, but hopefully it is fixed now.




回答2:


I've got ⠙WARNING: Invalid requirement, parse error at "'--upgrad'" though. I think you just need to update Pipfile with numpy = "*". Then, run pipenv install again.




回答3:


Pipenv is not meant to be a global and changing package manager like pip. It is a tool to keep several frozen environments per directory. It is a tool build on top of virtualenv and pip to create reproducible environments to share with others during development or future you.

If you want to "unfreeze" your environment you can either change the version of numpy in your Pipfile manually to the new desired version.

E.g.

[[source]]

url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"


[packages]
numpy = "1.14.4" # change this line to 1.14.5 or whatever version you want


[dev-packages]

or run

pipenv install --selective-upgrade numpy


来源:https://stackoverflow.com/questions/50939006/running-upgrade-with-pipenv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!