需要在不使用pip的情况下安装pymysql

2024-10-04 07:29:10 发布

您现在位置:Python中文网/ 问答频道 /正文

在我的工作中,我需要在几个安全的服务器上安装pymysql。他们不允许上网,所以我不能用pip。我确实下载了pymysql鸡蛋,但这需要cryprography。所以我下载了加密轮,但是当在上面运行pip install时,它试图从web上获取额外的数据。 我用的是Python3.7。有没有办法让整个pymysql包包括所有依赖项离线?在


Tags: installpip数据web鸡蛋离线pymysql办法
3条回答

@zappfinger。我建议您将主包及其依赖项下载到本地目录。然后使用pip install -r requirements.txt来执行任务。有关更多信息,请阅读link,并查看pip help install。你通常应该在仔细咨询所有这些帮助后完成工作。在

如果pymysqlcryptography都在服务器上的同一文件夹中,请尝试:

pip install  find-links DIR  no-index pymysql

find-links和{}将强制pip仅使用目录DIR中的文件来解析依赖关系。在

参见:

https://pip.pypa.io/en/stable/user_guide/#installing-from-local-packages

installing python packages without internet and using source code as .tar.gz and .whl

并查看:https://pythonhosted.org/Basket/以获得一种为这种类型的情况组合一个“篮子”包的方法。在

install pipmysql without internet

To install pmyssql on a system with no internet connectivity, you first download pymssql to a system. Follow these steps:

1) Download the Windows installer for the Python version and processor that is compatible with your system from the following website: https://pypi.python.org/pypi/pymssql/2.1.1#downloads.

2) Copy the file to the CA Strong Authentication or CA Risk Authentication server.

3) Run the installer and follow the prompts.

相关问题 更多 >