I am trying to install MySQLdb for Python on my mac so I can use it to test. I am running OS X 10.11.4. Everywhere I look says to use
pip install MySQL-python
Every time I do that I get an error saying.
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/4s/4wwhr6zj59sf0c4qkprqbsp80000gn/T/pip-build-042_KK/MySQL-python/
I am running the command just right when I open a new shell, should I change the path?
install mysql connector using homebrew brew install mysql-connector-c then install mysql-python using pip pip install mysql-python or try PyMySQL its a pure python client library, you can install using pip install PyMySQL and upgrade setuptools. pip install --upgrade setuptools.
Related
I have the same problem.
pyhton(3.9.1).
using virtual environmnet (venv).
installed django.
updated:
setuptools: pip install --upgrade setuptools,
pip(20.3.3): py -m pip install --upgrade pip
wheel: python -m pip install --upgrade pip setuptools wheel
(latesed version for today(30/12/20)).
Tried to use: python -m pip install -U channels.
installed "Microsoft Visual C++ Build Tools"
Tried the self installing twisted: https://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted
All done, but still not working.
Also tried pip install:
pip install pytype
pip install django-channels.
The django-channels, but when runnig on PyCharm, it recognize channels but not: channels.layers.
Can anyone help?
I managed to install it:
just removed python, and installed instead Anaconda 3.
I am not able to install connector for Snowflake Python using the below command :
python3 -m pip3 install --upgrade snowflake-connector-python
Its failing with below error :
/home/ssg.petsmart.com/nrahman/python3.8.5/bin/python3: No module named pip3
I have the pip3 packages present in lib location of Python3. I do not know why it is not working.
Use if it's the first time you are installing it
python3 -m pip install snowflake-connector-python
otherwise
python3 -m pip install --upgrade snowflake-connector-python
Error might be occurring with the version of python. Python version 3.5 is the best stable version for snowflake connector installation. For me below one worked well.
python3 -m pip install --upgrade snowflake-connector-python==2.1.1
for jupyter notebook use
!pip install --upgrade snowflake-connector-python==2.1.1 --user
I just finished installing the latest stable version of python via Homebrew.
$ brew install python3
Everything works fine. I would like to install packages, for example PyMongo.
I don't have pip.
$ pip
-bash: pip: command not found
and there is no Homebrew formulae for it:
$ brew install PyMongo
brew install PyMongo
Error: No available formula for pymongo
Searching formulae...
Searching taps...
Any idea what's the best way to install PyMongo on OS X when Python was installed via Homebrew. Thank you!
Use pip3. The "caveats" text you see when you run brew info python3 was printed for you after python3 was installed; that text is frequently helpful! It reads:
You can install Python packages with
pip3 install <package>
They will install into the site-package directory
/usr/local/lib/python3.4/site-packages
Can't install pycurl with pip, win xp x32, python 2.7.
here is the log
pip install pycurl
Downloading/unpacking pycurl
Downloading pycurl-7.19.3.1.tar.gz (116Kb): 116Kb downloaded
Running setup.py egg_info for package pycurl
Please specify --curl-dir=/path/to/built/libcurl
Complete output from command python setup.py egg_info:
Please specify --curl-dir=/path/to/built/libcurl
----------------------------------------
Command python setup.py egg_info failed with error code 10 in C:\Documents and S
ettings\User\build\pycurl
Storing complete log in C:\Documents and Settings\User\Application Data\pip\pi
p.log
Following the steps one mentioned above, solved my problem.
sudo apt install libcurl4-gnutls-dev librtmp-dev
pip install pycurl
This is a problem indeed. No need to update pip or easy install as it's often advised, well it won't hurt to update but you will still have the problem until you :
install libcurl4-gnutls-dev librtmp-dev packages
pip install pycurl
Worked the same in Linux
I had the same problem. I was able to install it with easy_install instead:
easy_install pycurl
For easy_install, see setuptools.
Here are easy steps I did to get around this:
Download the wheel of the version you want here: https://www.lfd.uci.edu/~gohlke/pythonlibs/
then you can pip install that like so:
pip install C:\sample\sample_dir\whl_file_downloaded
You should know be able to import in your python files
install pycurl using conda, conda will install all dependencies, Hope it works
conda install -c anaconda pycurl
steps to follow :
brew install openssl
PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/usr/local/opt/openssl/lib" CPPFLAGS="-I/usr/local/opt/openssl/include" pip install --no-cache-dir pycurl
For Linux Please install the libcurl-devel package and then try. It will work.
So has said by Hai Vu you need to install cURL first.
Here is the dowload page : http://curl.haxx.se/download.html
I suggest you install it in your C:/ directory, or if you already installed it elsewhere copye the curl.exe file to your c:/
When done, you can try it by going to the cmd prompt :
cd c:/
curl "your-curl-request"
If it works then curl is correctly installed and you can install pycurl with pip.
Hello when I attempt to install pylibmc on OSX Lion using pip I get the following error:
./_pylibmcmodule.h:42:10: fatal error: 'libmemcached/memcached.h' file not found
#include <libmemcached/memcached.h>
^
1 error generated.
error: command 'clang' failed with exit status 1
Any clues at how to solve this issue?
libmemcached may also be installed using Homebrew.
brew install libmemcached
After that, pip install pylibmc worked for me without needing to specify any additional arguments.
It's in the libmemcached package. To install it using macports:
sudo port install libmemcached
Then, assuming you're using pip:
pip install pylibmc --install-option="--with-libmemcached=/opt/local"
or
LIBMEMCACHED=/opt/local pip install pylibmc
as explained in the pylibmc docs.
I solved this issue by checking where memcached is installed
$ which memcached
/usr/local/bin/memcached
and then setting LIBMEMCACHED environment variable before pip install:
$ export LIBMEMCACHED=/usr/local
$ pip install pylibmc
Answer for Ubuntu users:
sudo apt install libmemcached-dev zlib1g-dev
I have the same problem because i have installed MEMCACHED and not LIBMEMCACHED, so, to resolve:
brew uninstall memcached #to remove wrong package
brew install libmemcached #install correct lib
pip install pylibmc
Its Works for me!
: )
For those finding this answer on Fedora:
sudo yum install libmemcached-devel
Hit the same error with macOS High Sierra, Python3.6 installed with brew. Solution for me was to export these flags, mentioned in this comment: Error when install pylibmc using pip
export LDFLAGS="-L/usr/local/lib"
export CPPFLAGS="-I/usr/local/include"
After that, pip install run just fine.
i fixed this by installing memcached from port
you should install first macports from http://www.macports.org/
then run this command
sudo port install memcached
after that download the pylibmc from the pypi http://pypi.python.org/pypi/pylibmc
extract .tar.gz file then
python setup.py install --with-libmemcached=/opt/local
this code is worked for me
sudo apt-get install libmemcached-dev zlib1g-dev
LIBMEMCACHED=/opt/local pip install pylibmc
Sometimes the X-Code Command Line Tools need to be installed.
xcode-select -p