I'm having issues installing ipython with sudo pip install "ipython[notebook]".
The error that I am seeing is
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-Jzcy1W/terminado
Any ideas on how I can resolve this?
In this case the issue seemed to be that setuptools was outdated. By updating setuptools pip install "ipython[notebook]" went through flawlessly and I am able to work in the interactive shell nicely.
Thanks to all that helped track this down.
egg_info errors installing ipython in windows
Right. I also faced this problem and later I updated setuptools and went for installing ipython.
To update setuptools run windows command and type :
python -m pip install --upgrade setuptools
Then, install ipython using pip:
pip install ipython
I am using python in windows and newbie. So your experienced problem
and solution might be helpful for me and others. Thanks!
Related
I'm trying to install firebase-admin on a Raspberry Pi. I have 3 cards with fresh Debian 10 (buster) (i.e. fully updated/upgraded), and tried 3 different ways to get firebase-admin to install (I know it can be done since I did it on another Raspberry Pi, but did so many things before I finally got it to install, that I can't reproduce what I did!). So in each attempt to install firebase-admin, I get the "python setup.py egg_info" failed with error code 1"
Here is what I did on 2 fresh cards in the RPi:
export PATH="/home/pi/.local/bin:$PATH"
python3 -m pip install google-cloud-storage (successful)
python3 -m pip install firebase (successful)
python3 -m pip install firebase_admin ---> fails with error shown above
I then tried sudo in front of the python3 commands above, with the same result. Finally, on one of the non-sudo cards, I did a "python3 -m pip install --upgrade pip setuptools wheel" (successful), and then repeated step 4 above with the same result (i.e. python setup.py egg_info" failed with error code 1).
I am desperate (and doing something really basic and stupid?) .... any help would be much appreciated! Thanks (I have tried all suggestions in questions similar to this one, without success).
Using a raspberry-pi zero W, almost identical problem. firebase works fine, firebase_admin fails with:
python setup.py egg_info did not run successfully. │ exit code: 1
It seems to work if you install the firebase admin package with an older version of grpcio. This is the command I used.
pip install firebase-admin "grpcio <= 1.40.0"
I don't know if it's necessary, but I had that specific version of grpcio already installed manually, from a previous attempt to fix the issue:
pip3 install --no-cache-dir --force-reinstall -Iv grpcio==1.40.0
Hope it helps!
I have two servers that are running CentOS 7.8 with all the latest patches as of the date of this post. On one server I can create a venv, and on the other I get an error. Here is the command used to create the venv:
python3.6 -m venv venv
The error is:
Error: Command '['/root/venv/bin/python3.6', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
So it seems there is a problem after the venv is created. In fact, it makes the links to the python interpreters in venv/bin, but the lib64/python3.6 and lib/python3.6 directories that are created have only empty site-packages in them. I get the problem whether running the command with root privileges (as above) or as a non-privileged user. On the other system, which is not quite the same hardware but very similar, I get no errors.
I have tried a bunch of things including completely uninstalling all the python3 rpms and reinstalling them on both systems. The python3 modules installed are:
python3, python3-devel, python3-libs, python3-other-rpm-macros, python3-pip, python3-rpm-generators, python3-setuptools, python3-tkinter, python3-wheel. All these are installed using the centos repos.
I have searched the internet and one thing that works is to use --no-pip. However, not surprisingly, if I do that I get a venv with no pip, which does not work very well. The version of pip that is installed with the rpm is version 9.0.3. However, I have tried upgrading pip:
python3.6 -m pip install --upgrade pip
This installs pip 20.1. Interestingly, it is installed in /usr/local/lib/python/site-packages. In any event, it doesn't change anything and I get essentially the same error message.
I have even gone as far as rsyncing the /usr/lib/python3.6 and /usr/lib64/python3.6 (using -avu --delete) on the two servers so that they are identical. All to no avail. I am at a loss to know what to do.
I can of course hack things to make them work, but since I am using this to automatically build test environments I really need to get it working automatically. Suggestions would be greatly appreciated.
I've had the same issue on CentOS Linux release 7.9.2009 (Core) and solved it by installing the following system packages:
yum install python36-devel
yum install python36-setuptools
yum install python36-virtualenv
python3.6 -m pip install --upgrade pip
Used virtualenv to install the venv into the project-root:
python3 -m virtualenv venv-dev
After sourcing the venv everything looks good and I could install the needed requirements:
. ./venv-dev/bin/activate
python3 --version
Python 3.6.8
pip3 --version
pip 21.1.1 from /project/root/dir/venv-dev/lib/python3.6/site-packages/pip (python 3.6)
pip3 install -r requirements/dev.txt
Successfully installed ...
Hi I am running Ubuntu 16.04.
I have had problems with my pip, it seems like it is installing correctly but when I open python and go to import, it gives me an error saying it cannot be found.
I read other posts and it seems like pip is talking to the wrong version of python.
When I run:
>> which pip
/home/Username/.local/bin/pip
>> which python
/usr/bin/python
I tried uninstalling pip and then reinstalling it but when I run "which pip" it comes up the same location. I can't use this pip to download any python packages. Does anyone have any idea how to fix this?
Edit:
When i put in the terminal the following commands the output is:
>> python -V
Python 2.7.12
>> pip -V
pip 9.0.1 from /home/heatdeath/.local/lib/python2.7/site-packages (python 2.7)
I don't think I'm suffering from the problem in this closely related question.
I'm running Linux Mint 16 (based on Ubuntu 13.10) and have Spyder 2.2.5 and IPython 0.13.2.
Under the Interpreters menu I only see Open a Python interpreter... and not an option to open an IPython interpreter.
Is there anything I have to do to "show" Spyder where IPython "is"?
Here is the output of my "Optional Dependencies":
IPython >=0.13 : 0.13.2 (OK)
matplotlib >=1.0: 1.2.1 (OK)
pep8 >=0.6 : None (NOK)
pyflakes >=0.5.0: 0.7.3 (OK)
pylint >=0.25 : None (NOK)
rope >=0.9.2 : 0.9.2 (OK)
sphinx >=0.6.6 : 1.1.3 (OK)
For me, the IPython console was not available anymore in Spyder (2.3.8) after updating IPython to version 4.1.1.
The solution was to install/upgrade qtconsole:
pip install -U qtconsole
See also https://github.com/spyder-ide/spyder/issues/2608#issuecomment-130586847
In principle you should be able to open an IPython console with View -> Windows -> IPython console... do you have this?
If this is not an option, try this: from an interpreter window,
import IPython
IPython.start_ipython()
In my case (Spyder3.0.0dev), I checked:
Help -> Optional dependencies
and saw that my IPython was outdated. So shut Spyder and I upgraded ipython,
sudo pip3 install ipython --upgrade
or if you use Python2:
sudo pip install ipython --upgrade
and restarted Spyder. Voila! IPython console is there
Had the same issue and in this case I missed the ipython-qtconsole package.
On my Mint OS :
sudo apt-get install ipython-qtconsole
did the trick.
I found the info there https://pythonhosted.org/spyder/installation.html after having tried the proposed solutions of this post
For python 3, following resolved the issue for me on Mint OS
sudo apt-get install ipython3-qtconsole
sudo pip3 install ipython --upgrade
sudo pip3 install qtconsole --upgrade
With this it's done and working!
For me on Sypder 3.7 this worked:
Consoles->Restart Kernal (Ctrl+.)
then:
Consoles -> Open an IPython console (Ctrl+T)
Coming over from Windows 10 to Linux Mint still more comfortable with the Software Manager, installed Spyder3, Ipython, Python-tk, and Ipython3-qtconsole, don't know if Ipython or Python-tk where necessary. Spyder3 now has a "Open IPython console" drop down under Consoles.
Is it possible to install psycopg2 into a virtualenv when PostgreSQL isn't installed on my development system—MacBook Pro with OS X 10.6?
When I run pip install psycopg2 from within my virtualenv, I received the error shown below.
I'm trying to connect to a legacy database on a server using Django, and I'd prefer not to install PostgreSQL on my development system if possible.
Why not install PostgreSQL?
I received an error when installing PostgreSQL using homebrew. I have Xcode4—and only Xcode4—installed on my MacBook Pro and am thinking it's related to missing gcc 4.0. However, this is a problem for another StackOverflow question.
Update 8:37 AM on April 12, 2011: I'd still like to know if this is possible without installing PostgreSQL on my MacBook Pro. However, I ran brew update and forced a reinstallation of ossp-uuid with brew install --force ossp-uuid and now brew install postgresql works. With PostgreSQL successfully installed, I was able to pip install psycopg2 from within my virtualenv.
Error from pip install psycopg2
$ pip install psycopg2
Downloading/unpacking psycopg2
Running setup.py egg_info for package psycopg2
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/matthew/.pip/pip.log
Preliminary Research
Below are the articles I read as preliminary research:
Installing psycopg2 to use Django with PostgreSQL on OS X
Installing psycopg2 on OS X
Using psycopg2 with virtualenv on Ubuntu JauntyLucid
Postgres, psycopg2, virtualenv install hints
apt-get install libpq-dev
helped me on debian squeeze
From comments:
apt-get install python-dev-is-python3
psycopg depends on pg_config command, and if you don't have it, you can't install psycopg.
If system installation is a problem to you, why don't you try compiling PostgreSQL and including generated bin files in your $PATH? Like:
export PATH=/path/to/compiled/postgresql/bin:"$PATH"
pip install psycopg2
brew install postgresql
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip3 install psycopg2
apt-get install libpq-dev
helped me in debian squeeze too . After that do pip install psycopg2. I faced problem of pg_config not found problem when i was setting up my environment on heroku , now its working fine .
You need to install the python-dev package in order to make use of python extensions such as psycopg2. I don't know how to install packages in mac but I run the following commands to install a python package on my Ubuntu machine.
sudo apt-get install python-dev
Or
sudo apt-get install python3-dev
if you are using Python3.x.
Once the installation is finished run the following command within your virtual environment.
pip install psycopg2
You don't need the complete PostgreSQL installed: you only need the client side libraries.
I solved it in MAC OSX using :
$ wget https://ftp.postgresql.org/pub/source/v9.5.3/postgresql-9.5.3.tar.bz2
$ tar xfv postgresql-9.5.3.tar.bz2
$ cd postgresql-9.5.3
$ ./configure
$ make
$ cd src/bin/pg_config
$ export PATH=`pwd`:"$PATH"
$ pip install psycopg2
Use pip install psycopg2-binary, it worked for me when pip install psycopg2 wasn't working.
Using the method you described in your April 12th update, I was able to install PostgreSQL(+1). Note that I originally was running Python 2.7.1 (32bit) and homebrew threw several errors and warnings regarding using a 32bit version of Python. I have since switched the 64/32 bit version of 2.7.1 and it works like a champ.
Regarding the pyscopg2, I was able to install it into my virtual environment from source by editing setup.cfg. I set pg_config to correct path inside homebrew's Cellar (pg_config=/usr/local/Cellar/postgresql/9.0.4/bin/pg_config). After saving the changes, I ran python setup.py install with zero issues. It's worth noting that I did not set the Mac's default python setting to 32 bit. I used the new 64 bit from start to finish.
After looking over some of the documentation, I think if I added homebrew's postgresql path to the system path I could have used pip to install it.
Reference:
http://favosdream.blogspot.com/2009/09/make-psycopg2-and-readline-work-in-snow.html
Update 6-8-2011:
While porting a project written on OS X to Windows 7, I found out that I had to install PostgreSQL on Windows as well. This ended up creating another user on my start up screen and other things that I just didn't like. While doing some digging I found Windows drivers for PostgreSQL here. I have since uninstalled the full PostgreSQL and installed the ODBC drivers which, thus far, work great.
To address the original question, after doing a bit more digging I think I found the equivalent ODBC for OS X here. I have not had a chance to try them out, but the concept works very well on Windows 7. I will update this when I get a chance to try them out. Until then, I hope this helps.
All from the above doesn't work for me (OS Catalina 10.15.1)
There was a conflict with classical postgres and homebrew version.
Please delete homebrew version by command
$ brew uninstall postgresql
and then install it from the official website:
$ sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
It is actual for a simple psycopg2 install or django-heroku package.
if you have recently updated python or changed default python (let's say from 3.6 to 3.8). The following code
sudo apt-get install python-dev OR sudo apt-get install python3-dev
will be installing/working for the previous python version.
so if you want this command to work for the recently updated/changed python version try mentioning that specific version like python3.8 in command like
sudo apt-get install python3.8-dev
try above with following
pip install wheel
export PATH=/path/to/compiled/postgresql/bin:"$PATH"
sudo apt-get install libpq-dev
sudo apt-get install python3.x-dev **Change x with your version, eg python3.8**
pip install psycopg2-binary
pip install psycopg2
As I never needed to install postgresql database on this server I installed the following libraries on Ubuntu 14_04 version before running pip install psycopg2 on the same server
apt-get install libpq-dev python-dev
and then executed pip install psycopg2 within virtual env.
Output
Collecting psycopg2
Using cached psycopg2-2.6.1.tar.gz
Building wheels for collected packages: psycopg2
Running setup.py bdist_wheel for psycopg2
Stored in directory: /root/.cache/pip/wheels/e2/9a/5e/7b620848bbc7cfb9084aafea077be11618c2b5067bd532f329
Successfully built psycopg2
Installing collected packages: psycopg2
Successfully installed psycopg2-2.6.1
I know you are asking for development environment but if you are deploying on server say, Heroku.
Just add below line in the requirements.txt of your project.
django-heroku==0.3.1
As this package itself will install the required packages like psycopg2 on server deployment.
Try to specify the version and it'll works, do it inside the venv
pip install psycopg2-binary==2.8.6
based on my experience, apt install libpq-dev then try to install psycopg2 inside venv will fix many issues, however for more information you can refer to this link:
https://www.psycopg.org/docs/install.html