Install Python package from GitHub using PyCharm

I created 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 usually use PyCharm's built-in search tool, but I'm not sure how to properly install it in VirtualEnv in PyCharm from GitHub. Does anyone know how to do this?

+10
python github pycharm
source share
5 answers

I personally would suggest cloning the repository to a local folder

git clone https://github.com/django-nonrel/django.git my_folder 

Then install it manually:

 cd my_folder python setup.py build python setup.py install 

I would not recommend using PyCharm to install packages, since you will become dependent on it ... Instead, use pip, which is the pycharm tool anyway

+4
source share

The following works 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 the PyCharm terminal window ( Alt F12 or View> Tool Windows> Terminal) and then used the command

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

install pyodbc from the "unicodecolumnsize" branch of the v-chojas user v-chojas .

After the installation was completed, the package was found in the widow of the translator of the project.

On OSX + PyCharm 2018.1, you must restart PyCharm in order to receive the changes and recognize the import from the newly installed packages.

pycharm.png

+10
source share

I tried to find a way to do this in the PyCharm user interface, but this is possible thanks to the Python integrated console:

  • Download the project using the appropriate VE
  • From the Tools drop-down list, click Python Console
  • Then use pip from the console:

     import pip pip.main(['install','packagename']) 
+6
source share

Alternatively, in the console:

 pip install -e git+https://github.com/%%#egg=Package 
+2
source share

I ran into the same problem, all I did: configured a project interpreter for Python3 inside venv / scripts, which you use to install pip. Remember to activate venv. Now you can use pip installation on pycharm or Prompot. The problem is that even with "venv / lib / sitepackeges" in your sys.path project, pycharm only searches for packages in which the project interpreter

0
source share

All Articles