Pycharm Error - No module named MySQLdb - python

I have installed MySqldb as shown below:-
jab-MacBook-Pro-4:silkroute deb$ pip install MySQL-python
Collecting MySQL-python
Installing collected packages: MySQL-python
Successfully installed MySQL-python-1.2.5
But still I am getting the error:-
python --version
Python 2.7.11
I am using version 2.7.10 in PyCharm
I have also installed MySQLDB as shown below:-
jab-MacBook-Pro-4:silkroute deb$ pip2.7 install MySQL-python
Requirement already satisfied: MySQL-python in /usr/local/lib/python2.7/site-packages
Can someone let me know how can I get rid of this error?

Your Pycharm was not using the right python environment.You can change the project interpreter by setting Pycharm.
Step:File-> SettingsIn Popup menu: Project-> Project Interpreter-> add or create virtualenv environment
After changing project interpreter, the Pycharm has many function to use

Open PyCharm, File>>Default Settings>>Project Interpreter>>Select the Interpreter you want to install the packages to, press the red '+' sign to the right, search the package and install.
This should most probably correct your error. You are better off creating a virtualenv though, will be really helpful. Use this to get started

You may have multiple Python versions installed.
Use pip2.7 to see if this installs on the right python version.
Check this post: pip: dealing with multiple Python versions?

Related

What is the reason of ModuleNotFoundError: No module named 'mysql' in Python 3.8.10 and Requirement already satisfied in anaconda location problem?

I need to import mysql-connector and I installed it by using pip install mysql-connector-python.
After the installation, I can see the same error is displayed.
After that again I tried to install mysql connector, but it displayed that Requirement already satisfied and show a path in anaconda lib folder.
Is there any effect from previous installation on Anaconda and how to import mysql-connector to code?
As a solution for that, I changed the interpreter of the code into ('base': conda). It worked correctly without any error.

How do I install python package tobii_research?

I am trying to install tobii_research for a project and I was following the instructions on http://developer.tobiipro.com/python/python-getting-started.html
I already have python 3.7.6 and pip 21.1.2 installed on my Mac.
When I run pip install tobii-research I get:
ERROR: Could not find a version that satisfies the requirement tobii_research (from versions: none)
ERROR: No matching distribution found for tobii-research
Was there something I forgot to install?
I can not for the life of me figure out how to install this manually either.
Help with pip, or installing manually would be greatly appreciated, but you might have to explain it to me like I am stupid.
Thanks in advance.
It appears that you are not running the correct python version for the versions of the package that are available. If you look at the wheel files available on the tobii-research Downloads page, the software is packaged for either python 2.7 or 3.6.
When trying to install this package myself, I get the same error message as you when trying to install it for python 3.8, but the package installs successfully with my python 2.7 installation.
I would recommend installing a compatible version of python and then running pip through that version using the following command:
[specific_python_installation] -m pip install tobii-research
Try doing it with pip again, but replace the underscore with a hyphen as shown below:
pip install tobii-research
I saw on the PyPi website that they only have it for Python 3.8, so I downloaded that Python version from their official website and installed it (do not add it to path).
Then, I created a virtual environment selecting 3.8 as the Python version (refer to this answer) and activated that virtual environment.
Finally, I run pip install tobii_research and it worked.
One thing that helped me - required Python version. For example, for the version 1.10.2 (which is current at the moment of writing this) only Python 3.10 is supported. Check the list of files distributed within this version.
I was able to install the package on Windows with Python 3.10 but on MacOS I had the same problem and wasn't able to resolve this - I assume it's a problem with the architecture, as there is no version for arm64 if you have a Mac with M1 processor.

Python 3.8.5 and MYSQLDB

As of late, I have been attempting to setup MySQLDB on Pycharm. I have Python 3.8.5 installed, have made sure the PATH is set, and everything seems to be working handily. After this, I ran the pip command.
python -m pip install mysqldb
and
python -m pip install mysqldb-python
But to no avail.
I tried to install it from Pycharm's interpreter page, but also no dice. I also attempted to install using a .whl file, but that has also turned out a failure. I've searched far and wide for the last few days, and I've found mention of this error, but none of the fixes I've seen have truly worked. The error I get is the same, regardless of which iteration I attempt to install. And of all the guides I see, I never see any mention of steps I've missed or things I should have done before attempting an installation aside from what I've done. The error is as follows.
ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none)
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Could not find a version that satisfies the requirement MySQLdb (from versions: none)
ERROR: No matching distribution found for MySQLdb
you can try installing the following,
pip install pymysql
pip install mysql-connector
pip install mysql-connector-python
or you can go to lfd.uci.edu/~gohlke/pythonlibs/#mysql-python and install the wheels.
It looks like you're using the wrong package to try to install mysqldb through pip. I tried it and got the same error you did this tells me that pip is looking for a package to download and install, but cannot find it.
Try this instead:
pip install MySQL-python
You can learn more about this package here:
https://pypi.org/project/MySQL-python/#description

Pip install database command is not working for Python 3.8.0

I have installed Python 3.8 and using it with Pycharm; moreover, I am working with mongodb for which i have to install "pip install database" which provides the following error:
ERROR: Could not find a version that satisfies the requirement database (from version:none)
Moreover, Pycharm proposed a solution:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'E:\Python set up file\python.exe'.
Any suggestions how could I fix this problem and install it properly?
I think you are looking for pip install databases but not pip install database
ref: https://pypi.org/project/databases/

Robot Framework installation issue

Whenever i try to install Robot Framework. I am getting the error message below.
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
What is the issue?
I am installing robotframework-2.6.3.win32 with python2.7.2
I'm not sure what is causing your specific issue, but I find that using pip or easy_install works for installing robotframework and any plugins on windows
Do you change your installed Python folder name ? Please use internal set-up command line in Python for adding plugin.
I'm assuming from the win32 extension that this is for Windows. In which case I would suggest checking installing with pip which can be found in section 1.3.3
http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html
Check if pip is installed with your python version
pip --version
Else use below link to install
https://pip.pypa.io/en/stable/installing/
once pip is installed , you can try to install robotframework with specific version like below
pip install MySQL_python==1.2.2
I'm not sure the cause for your issue. but you are trying to install an older version of Robot framework on an Older python build. I suggest you to try a newer version such as 'Robot Framework 3.2.2 (Python 3.7.9 on win32)'. Then, it's easy since pip is installed by default if you are using Python 2 >=2.7.9 or Python 3 >=3.4. (you can check by > "py -m pip --version")
Installing Robot Framework is just a two-step process now.
install python from https://www.python.org/downloads/
install robotframework from https://pypi.org/project/robotframework/ > "pip install robotframework" (You can check the version by > "robot --version")
Read more - https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#installation-instructions

Categories

Resources