On my job, I need to install pymysql on several secured servers. They do not allow internet access, so I can not use pip. I did download the pymysql egg, but this requires cryprography. So I downloaded the cryptography wheel, but when running pip install on that it tries to get additional data from the web. I'm using python3.7. Any way to get the whole pymysql package including all dependencies off line?
3 Answers
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.

- 32
- 4
-
Please do not answer with only a link, [they should *never* be the only piece of information in your answer.](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers) You should at the very least quote the relevant section as part of your answer. – r.ook Nov 20 '18 at 15:23
-
Your answer contains information specific related to the company of your link. The CA server part. – RvdK Nov 20 '18 at 15:29
With the wheel's for both pymysql
and cryptography
in the same folder on your server, try:
pip install --find-links DIR --no-index pymysql
--find-links
and --no-index
will force pip to resolve the dependency only using the files in the directory DIR
.
See:
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
And check out: https://pythonhosted.org/Basket/ for a way to put together a "basket" of packages w/ dependencies for this type of situation.

- 825
- 9
- 19
-
I tried you suggestion, but I got the following output: C:\Users\rvbemmelen\PyMySQL-0.9.2>c:\Python37\python -m pip install --find-links --no-index pymysql Looking in links: --no-index Requirement already satisfied: pymysql in c:\users\rvbemmelen\pymysql-0.9.2 (0.9 .2) Collecting cryptography (from pymysql) Url '--no-index' is ignored. It is either a non-existing path or lacks a speci fic scheme. Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))....(some socket error) So it seems it is still trying to get some more, will have look at basket. – zappfinger Nov 21 '18 at 07:54
-
Ah, `--find-links` needs to actually included the specified directory, I'll edit to reflect that. – Hal Jarrett Nov 21 '18 at 15:21
@zappfinger. I would suggest you download your main package and its dependencies to a local directory. Then use pip install -r requirements.txt
to perform your task. For more information read link and have a look at pip help install
. You should normally get your work done after carefully consulting all these help.

- 527
- 3
- 10