How do I import python modules into Pycharm offline

3033 views python
2

I have some offline computers which I cannot connect to the Internet. Not surprisingly, several of the modules are outdated. How do I update them and also add new ones?

I am envisioning downloading something from the Internet, putting it on a flash drive, then loading it somehow into Pycharm. This question is about the first and last steps.

Pycharm 2018, Windows 10

answered question

You can install with wheel file, open CMD and type -> pip install D:/some-folder/your-file.whl

2 Answers

11

If you look at the second most voted answer on this SO post you'll see the general way of doing it. You can do that with your virtualenv activated, then the packages should show up in PyCharm just fine

posted this
9

You need the downloaded packages from somewhere that connected to internet then store it as via

# in case of just single package
$ pip install <package> --download <path>/offline_packages

# incase you need a list of pakages
$ pip install --download <path>/offline_packages -r requirements.txt

Tranfer the to your machine (by anyway you can)

Install these packages to your current Pycharm's Python directory via:

# single package
$ pip install --no-index --find-links="<path>/tranferred_packages" <package>

# list of dependencies
$ pip install --no-index --find-links="<path>/tranferred_packages" -r requirements.txt

Hope this can help you :)

posted this

Have an answer?

JD

Please login first before posting an answer.

Ads

Categories