简体   繁体   English

如何忽略我使用 pip 安装包的开发项目

[英]How to ignore my development project for installing a package with pip

I uploaded my package to testpypi , and installed it via:我将我的包上传到testpypi ,并通过以下方式安装它:

pip install -i https://test.pypi.org/simple/ myporj==0.1.6

However it refuse to install it by saying:但是它拒绝安装它说:

Requirement already satisfied: myproj==0.1.6 in ./projs/myproj (0.1.6)

I guess I may add the project in editable mode:我想我可以在可编辑模式下添加项目:

pip install --editable .

However, I know want to disable it.但是,我知道要禁用它。 I tried:我试过:

python setup.py develop --uninstall

But it has no effect.但它没有效果。

It may be worth creating a separate env (Virtual Environments) for the installation.可能值得为安装创建一个单独的 env(虚拟环境)。

Here are some articles on this subject:这里有一些关于这个主题的文章:

  1. https://docs.python.org/3/tutorial/venv.html https://docs.python.org/3/tutorial/venv.html
  2. https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment

Or does it need to be installed in the same place?还是需要安装在同一个地方?

You can try to find your package pip search myporj or pip list for show all packages.您可以尝试查找您的包pip search myporjpip list以显示所有包。

And uninstall it later pip uninstall myporj (it may require the right of sudo in linux) then install again.并稍后卸载它pip uninstall myporj (它可能需要 linux 中的sudo权限)然后再次安装。 Maybe you may need --no-cache-dir option to ignore the cache during installation.也许您可能需要--no-cache-dir选项在安装过程中忽略缓存。 Here is more details: https://pip.pypa.io/en/stable/reference/pip_install/#caching以下是更多详细信息: https : //pip.pypa.io/en/stable/reference/pip_install/#caching

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM