Can't install MySQL-python [CentOS] - python

I need mysql-python on my CentOS 7 server to run a script I wrote. I haven't found any success installing it I always get the following error:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-
build-mpl_yksf/mysql-python/
I am running CentOS 7 and accessing my machine through ssh.
I have tried the following:
-Installing mysql-python on Centos
-can't install MySQL-Python
python-dev is installed hopefully for the right version of python, gcc is also installed in fact I run:
# yum groupinstall "Developper Tools"
-mysql_config not found when installing mysqldb python interface
Tried the solution provided here to install the package directly in the same directory as python 3.7 instead of the default one which was the one containing python 2.7:
https://unix.stackexchange.com/questions/323532/yum-install-package-name-to-different-directory
I
# yum --installroot=/usr/local/bin/ --releasever=/ install MySQL-python
Per this I can't simply uninstall python 2.6:
-How to uninstall Python2.6
And I don't think simply creating an alias will solve my problem generally python 3 launches automatically not python 2 but my problem is regarding mysql-python
Essentially I think I have narrowed it down to the fact that I don't have mysql-python accessible to pthon 3.7 for some reason. It seems my 2 versions of python are somehow conflicting. I am wondering what I can do to fix this ? Before you suggest I tried running my program through python 2 but some exceptions I have to catch were not yet available.
All I want to do is get rid of this error message:
ModuleNotFoundError: No module named 'mysql'
Could someone please help me ? I wasn't sure whether it was better to post in unix.stackexchange.com but it seems appropriate to stackoverflow

The error you are getting (Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mpl_yksf/mysql-python/) is because of a missing package ConfigParser.
In Python 3, ConfigParser was renamed to be configparser (all lowercase) to comply with PEP 8 standards. As of now, MySQL-python has not been updated to support Python 3.
You are left with two choices:
Use Python 2 for whatever you are trying to do. This implies using pip2 command instead of pip3.
Use an alternative package, such as mysqlclient.
To install mysqlclient, you will first need libmysqlclient-devel. Then you can install the Python 3 module via pip.
$ pip3 install mysqlclient

Related

Command "python setup.py egg_info" failed with error code 1 with table package

I am trying to install a specific version of python package tables==2.4.0 for some reasons. But every time I am getting the error
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-tJYQ8o/tables/.
If I try with pip install tables, then this works fine and tables package with version 3.4.3 will be installed. But I need specifically 2.4.0 or 2.x.
I have also checked
https://stackoverflow.com/questions/44981793/python-setup-py-egg-info-failed-with-error-code-1
and
https://stackoverflow.com/questions/35991403/pip-install-returns-python-setup-py-egg-info-failed-with-error-code-1
but didn't get success.I also tried virtualenv, the same error is coming with this version and latest version is working fine.I am using virtualenv for python version 2.7.12 in Ubuntu 14.04. Can anybody suggest me for this issue.
Thanks.
I think the problem is that the version of tables you want to install (2.4.0) is not compatible with the version of numpy you have installed. The incompatibility is due to a bug in setup.py that comes with the tables package.
See the following bug report https://github.com/PyTables/PyTables/issues/601
The person that reported the bug provides a patch here: https://gist.github.com/prehensilecode/2eb790476c38299e520ce5ea40896e08
To try and fix this myself I downloaded the 2.4.0 table package (pip download tables==2.4.0) and applied the patch to setup.py
I made sure I had the tables dependencies installed (numpy, numexpr and cython), and you will also need to make sure you install the necessary HDF5 files (sudo apt install libhdf5-serial-dev) then I ran:
sudo python setup.py install --hdf5=/usr/lib/i386-linux-gnu/hdf5/serial/
The path to your HDF5 files may be different to mine of course.
import tablesfrom a python prompt then works

Module installation in python returning "Could not find any downloads that satisfy the requirement" error?

Unfortunately I cannot install any modules on python 3.4 32 Bit using the pip command due to the following error.
How do I get around the problem. I have removed all other installations of python and have installed the 32 Bit version rather than the 64 Bit one?
Thanks
Edit 1:
At the moment I can't even upgrade pip
Edit 2
Unfortunately it still returns an error.
Try upgrading your pip with
python -m pip install -U pip
If this fails too, it has to be a network problem. See if you're properly connected to internet.
Seems like you might be using an old version of PIP which is facing SSL certification issues and is hence unable to connect. You can do a manual reinstall of pip using these commands.:
python -m pip uninstall pip setuptools
Then, download this script
Finally, run the script with:
python get-pip.py

Python 2.7 easy_install - the process cannot access the file because it is being used by another process error

Using Python I am trying to install a library called yappi through easy_install. However I am getting this error below on Windows 7 Command Shell:
I explored alternative installations. I tried previously 'pip install yappi' but this didn't work due to a separate error (can't build wheel) which is a separate question.
Try downloading the appropriate wheel from here.
Then use pip install [package].

Python 3.x - Error while installing packages using pip

I've got a problem while I want to install couple packages for python 3.4.
The problem appears while I want to type pip. Any commands after word pip, easy_install are giving the same error. Installed get-pip.py before but the error still occurs:
C:\Users\Konrad>pip
Fatal error in launche: Job information querying failed
I'm running windows10 x64. The cmd was in admin mode.
Aby suggestions? I typed that error message through google, but there weren't any helpful answers.
Running python just works and launches Python 3.4.3.
That doesn't look like the Python pip command. You have a different pip executable in the way somewhere.
Use python -m pip as a work-around; it'll use Python to find the module and use it as a command-line tool (which is explicitly supported):
python -m pip install <something>

pip issues - mac os 10.7.5

I've been struggling for a while trying to get pip to work correctly.
I have (I think) successfully installed pip, and when I run 'sudo pip install --upgrade setuptools,' I get the message that setuptools is up to date.
When I try to install a package, however, (in this case redis), I get the following error message:
error: invalid command 'egg_info'
In addition, the following is also printed:
Command python setup.py egg_info failed with error code 1 in /private/var/folders/lf/c8q5s8nd3h726l_x165442d80000gn/T/pip_build_Cbelden/redis
Storing debug log for failure in /Users/Cbelden/Library/Logs/pip.log
(Possible) Clues:
When running the 'which' command I noticed both pip and easy_install are in /usr/local/bin/ but python is in /usr/bin/. Could this cause some issues? Any help is appreciated.
As of now, there seem to be two Python installations in both /Library/Frameworks and in /System/Library/Frameworks (I do not know if this is normal or not).
I backed up my system and upgraded to Mavericks. Whatever the new default Python distro is cleaned up any sort of crap I had installed earlier. I had an enthough distribution installed, which I think was the cause of my issues. pip now works successfully.

Categories

Resources