Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Python package from GitHub using PyCharm

I created a VirtualEnv in PyCharm to install my Python packages. I wanted to install this fork of the django project from GitHub.

https://github.com/django-nonrel/django

For packages available from PyPI I would normally use the built-in search tool in PyCharm, but I'm not sure how to correctly install it into the VirtualEnv within PyCharm from GitHub. Would anyone know how to do this?

like image 859
Jim Avatar asked Jan 10 '14 15:01

Jim


People also ask

Can install Python packages in PyCharm?

PyCharm provides methods for installing, uninstalling, and upgrading Python packages for a particular Python interpreter. By default, PyCharm uses pip to manage project packages.

How do I import a package into PyCharm?

PyCharm can do both. Type the name of the package and hit Alt-Enter , then choose Install and Import package . PyCharm will do both: you'll see a notification during the installation, then the import will be generated in the right way, according to your project styles.

How do I download a package from GitHub?

On GitHub, navigate to the main page of the repository. Click the Clone or download button located under the repository name. A dropdown is displayed. Click on Download ZIP and save the repository as a zip file to your system.


1 Answers

The following worked for me with PyCharm Community Edition 2018.1 on Xubuntu 16.04:

After loading the project (which was associated with the virtual environment that I wanted to update), I opened PyCharm's Terminal window (AltF12, or View > Tool Windows > Terminal) and then used the command

pip install git+https://github.com/v-chojas/pyodbc@unicodecolumnsize

to install pyodbc from the "unicodecolumnsize" branch of the fork maintained by user v-chojas.

Once the install was completed the package showed up in the Project Interpreter widow

On OSX+PyCharm 2018.1 needed to restart PyCharm to pick up the change and recognize the imports from the newly installed packages.

If PyCharm does not pick up on the library and places red underlines on your imports, do a File->Invalidate caches/restart and choose invalidate and restart PyCharm.

pycharm.png

like image 51
Gord Thompson Avatar answered Sep 20 '22 10:09

Gord Thompson