pip3 install psycop2==2.7.*
I try to install Django project on a live server but when I install the package I am getting error! pip install psycopg2==2.7.*
You have to install "headers" for C extension. In this case you should install libpq-dev
sudo apt install libpq-dev
I tried reinstalling it ,but for us to install pythin packages use the pip's version to specify instaltion for ex pip3 install pandas.
Try to install pip with the following command:
sudo apt-get install python3-pip
Or:
sudo apt-get install python3-dev
I used this command in terminal
sudo apt-get install python-setuptools
it throws up an error instead of installing -
Package 'python-setuptools' has no installation candidate
THis is a python package so you could use pip to install it
pip3 install setuptools
Try this:
sudo apt-get install python-pip
When pip is installed type in:
pip install setuptools
Hope this helps!
I'm trying to install python-numpy package on my ubuntu 14.04 machine. I ran sudo apt-get install python-numpy command to install it and it says the package has been installed but when i try to access it, i'm unable to do so.
When you type:
sudo pip install package-name
It will default install python2 version of package-name some packages might be supported in both python3 and python3 some might work might not
I would suggest
sudo apt-get install python3-pip
sudo pip3 install MODULENAME
or can even try this
sudo apt-get install curl
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
sudo pip3 install MODULENAME
Many python packages require also the dev package, so install it too:
sudo apt-get install python3-dev
Also check for the sys.path [ make sure module is in the python path ]
I created virtualenv for django 1.9 project. I am trying to pip install mysqlclient or mysql-python but both of them gives me errors.
pip install mysqlclient
pip install mysql-python
both give me the same error message:
Command "python setup.py egg_info" failed with error code 1 in
/private/var/folders/r4/bkv_4t9s4r140pjkgv6lsq8w0000gn/T/pip-build-cdxcssp9/mysqlclient
any suggestions!?
Try to run this before:
Ubuntu:
sudo apt-get install python-dev python3-dev
sudo apt-get install libmysqlclient-dev
pip install pymysql
pip install mysqlclient
In OSX:
sudo xcodebuild -license accept
brew install mysql-connector-c
This is probably due to your mysql_config being broken.
As of 2019, here is how to run smoothly pip install mysqlclient on MacOS:
brew info openssl and follow the commands at the bottom
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
Other approaches:
brew install/upgrade/reinstall mysql : did not fix the issue for me, but has the nice side effect to make sure your installation is clean.
brew install mysql-connector-c : to make that work you have to unlink mysql, which ruins your setup and it did not fix the issue for me.
If you're using Anaconda (which I highly suggest you) then run these two commands
conda install -c anaconda mysql-connector-python
and
conda install -c bioconda mysqlclient
Download the MySQL APT repository config tool (you can see more details here: http://dev.mysql.com/downloads/repo/apt/)
wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb
Install the MySQL APT repository config tool
dpkg -i mysql-apt-config_0.7.3-1_all.deb
You will be asked to select product and version that you want to install. In the first step, select Server and next select either mysql-5.6 or mysql-5.7. Then click Apply.
Update APT
apt-get update
Install the server
sudo apt-get install mysql-community-server
sudo apt-get install python-dev python3-dev
sudo apt-get install libmysqlclient-dev
pip install pymysql
pip install mysqlclient
If you are using Python 2.x, and already have installed:
MySQL Server
Python Connector
Then the problem is when you run:
Windows:
(your environment) SomePath> pip install mysqlclient
Mac OS:
$ pip install mysqlclient
Actually it is asking to install package for Python 3.x not 2.x. So it is throwing an error.
Solution is to run:
Windows:
(your environment) SomePath> pip install mysqlclient==1.3.9
Mac OS:
$ pip install mysqlclient==1.3.9
P.S The mysqlclient==1.3.9 version is the latest version for Python 2.x
For Ubuntu 18.04
sudo apt-get install python-dev python3-dev
sudo apt-get install libmysqlclient-dev
pip install pymysql
pip install mysqlclient
and setup
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'DB_NAME',
'USER': 'DB_USER',
'PASSWORD': 'DB_PASSWORD',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
This worked for on Ubuntu 18.04
sudo apt-get install python3.6-dev
sudo apt-get install mysql-client
sudo apt-get install libsqlclient-dev
sudo apt-get install libssl-dev