通过 pip 将软件包安装到单独的目录



我正在尝试将依赖包安装到现有项目中的单独目录中,如下所示:

python -m pip install -t C:UsersMahdieclipse-workspace
google-cloud-functionscommahdipythonfunctionsgcsdependency com.mahdi.python.file_igestion

但我得到以下错误。我缺少什么吗?

Could not find a version that satisfies the requirement com.mahdi.pyhton.file_igestion (from versions: )
No matching distribution found for com.mahdi.pyhton.file_igestion

编辑:根据建议,我可以通过 setup.py sdidst安装软件包,我可以看到已安装的软件包

C:UsersMahdieclipse-workspacegoogle-cloud-functions>python -m pip list
Package                  Version    Location
------------------------ ---------- -------------------------------------------------------
file-ingestion           0.2        c:usersmahdieclipse-workspacegoogle-cloud-functions

但是当我运行打击命令时,我仍然收到错误

C:UsersMahdieclipse-workspacegoogle-cloud-functionscommahdipythonfunctionsgcs>python -m pip install -t C:UsersMahdiecli
pse-workspacegoogle-cloud-functionscommahdipythonfunctionsgcsdependency file-ingestion
Collecting file-ingestion
  Could not find a version that satisfies the requirement file-ingestion (from versions: )
No matching distribution found for file-ingestion
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

要安装您在本地构建的软件包,您需要使用类似于

pip install mypackage --no-index --find-links file:///srv/pkg/mypackage

您需要先使用 python setup.py sdist 将其打包。

最新更新