Just upgraded to 5.0.3 macOS version and mysql is not found

169 views
Skip to first unread message

Alper

unread,
Jun 2, 2021, 7:30:20 PM6/2/21
to spyder
Hi all,

Just upgraded to 5.0.3 with direct download.

Getting the following:
import mysql.connector
ModuleNotFoundError: No module named 'mysql'

I have tried the following:

pip3 install mysql-connector-python <- didn't solve it

pip3 install mysql-connector <- didn't solve it

pip3 install mysql-connector-python-rf <- didn't solve it

conda install -c anaconda mysql-connector-python <-this one failed

failed                                           

UnsatisfiableError: The following specifications were found

to be incompatible with the existing python installation in your environment:

Specifications:

  - mysql-connector-python -> python[version='>=2.7,<2.8.0a0|>=3.7,<3.8.0a0|>=3.6,<3.7.0a0|>=3.5,<3.6.0a0']

Your python: python=3.8

Does that mean I have to downgrade my python version?

Thanks,

Philip Yip

unread,
Jun 3, 2021, 5:34:24 AM6/3/21
to spyder
The direct download has its own Python environment which is independent of Anaconda. It has numpy, matplotlib, pandas and scipy but none of the additional data science libraries. It also can't use pip and conda commands.

Ensure you have anaconda 2021-05 installed (the latest standalone installer).
In Windows open up the Anaconda PowerShell Prompt or in Linux/Mac open up the Terminal.
Type in:
conda update --all
This should update the Anaconda Python distribution to the latest stable version, specifically updating Python to a compatible version for Spyder 5.

Next search the anaconda and conda-forge channels for the latest Spyder release:
conda search --channel anaconda spyder
conda search --channel conda-forge spyder

At the time of writing the conda-forge channel is more up to date than the anaconda channel.
Type in:
conda install --channel conda-forge spyder=5.0.3
On my Linux and Windows 10 install not specifying the version number preferenced spyder version 4.2.5, so I had to specify 5.0.3 to begin the install.

yfprojects

unread,
Jun 3, 2021, 7:53:55 AM6/3/21
to spyder
Hi,
Philip correctly states how to install spyder 5.0.3 inside Anaconda. This allows you to use the python packages in the base environment inside spyder. You can install new ones using conda or the Anaconda Navigator.
If you don't want to use Anaconda,  you can also select the normal (cpython) interpreter as python interpreter in Preferences > Python Interpreter > Python Interpreter > Use the following Python interpreter. Spyder expects the executable file of the program that is also run by the `python3` terminal command. On MacOS this should be /usr/bin/python3. Now you can install packages using pip and use those packages in the console or when executing a program in spyder.

Kind regards
yfprojects

Alper

unread,
Jun 8, 2021, 9:14:30 AM6/8/21
to spyd...@googlegroups.com
Hi team, 

Both options didn't work. Without Anaconda, with my direct path as @yfprojects suggested, I get the following:

Your Python environment or installation doesn't have the spyder‑kernels module or the right version of it installed (>= 2.0.1 and < 2.1.0). Without this module is not possible for Spyder to create a console for you.

You can install it by running in a system terminal:

conda install spyder‑kernels=2.0

or

pip install spyder‑kernels==2.0.*


When I try the pip install spyder-kernels==2.0.* or pip3 install spyder-kernels==2.0.*, I get "Requirement already satisfied" on all kernels.

I'll completely uninstall Anaconda and re-install it again. Something majorly is messed up in my environment :) just can't figure it out what.

Thanks,

Alper

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/d8f84ff3-f539-4969-8e16-1194f362609en%40googlegroups.com.

yfprojects

unread,
Jun 8, 2021, 10:39:12 AM6/8/21
to spyder
Hello,
It looks like spyder-kernels is already installed in your standard Python but the wrong version of it.
Try `pip install -U "spyder-kernel==2.0.*"` instead to update it.

Kind regards
yfprojects

Alper

unread,
Jun 8, 2021, 2:23:37 PM6/8/21
to spyd...@googlegroups.com
Hi @yfprojects,


That does not seem to help either:


pip install -U "spyder-kernel==2.0.*"

ERROR: Could not find a version that satisfies the requirement spyder-kernel==2.0.* (from versions: none)

ERROR: No matching distribution found for spyder-kernel==2.0.*




Pat F

unread,
Jun 8, 2021, 3:12:17 PM6/8/21
to spyder
Looks like you need underscore - not dash.

spyder_kernels

Alper

unread,
Jun 8, 2021, 4:19:04 PM6/8/21
to spyd...@googlegroups.com
Hi Patf and yfprojects,

Thanks for all the help. Unfortunately, still no good:

$ pip install -U "spyder_kernels==2.0.*"

Requirement already satisfied: spyder_kernels==2.0.* in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (2.0.3)

Requirement already satisfied: jupyter-client>=5.3.4 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (6.1.12)

Requirement already satisfied: ipython>=7.6.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (7.24.1)

Requirement already satisfied: cloudpickle in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (1.6.0)

Requirement already satisfied: wurlitzer>=1.0.3 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (2.1.0)

Requirement already satisfied: pyzmq>=17 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (22.1.0)

Requirement already satisfied: ipykernel>=5.3.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (5.5.5)

Requirement already satisfied: decorator<5 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from spyder_kernels==2.0.*) (4.4.2)

Requirement already satisfied: tornado>=4.2 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipykernel>=5.3.0->spyder_kernels==2.0.*) (6.1)

Requirement already satisfied: appnope in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipykernel>=5.3.0->spyder_kernels==2.0.*) (0.1.2)

Requirement already satisfied: traitlets>=4.1.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipykernel>=5.3.0->spyder_kernels==2.0.*) (5.0.5)

Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (3.0.18)

Requirement already satisfied: pickleshare in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (0.7.5)

Requirement already satisfied: backcall in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (0.2.0)

Requirement already satisfied: matplotlib-inline in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (0.1.2)

Requirement already satisfied: jedi>=0.16 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (0.18.0)

Requirement already satisfied: setuptools>=18.5 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (56.0.0)

Requirement already satisfied: pygments in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (2.9.0)

Requirement already satisfied: pexpect>4.3 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from ipython>=7.6.0->spyder_kernels==2.0.*) (4.8.0)

Requirement already satisfied: parso<0.9.0,>=0.8.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jedi>=0.16->ipython>=7.6.0->spyder_kernels==2.0.*) (0.8.2)

Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jupyter-client>=5.3.4->spyder_kernels==2.0.*) (2.8.1)

Requirement already satisfied: jupyter-core>=4.6.0 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from jupyter-client>=5.3.4->spyder_kernels==2.0.*) (4.7.1)

Requirement already satisfied: ptyprocess>=0.5 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from pexpect>4.3->ipython>=7.6.0->spyder_kernels==2.0.*) (0.7.0)

Requirement already satisfied: wcwidth in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=7.6.0->spyder_kernels==2.0.*) (0.2.5)

Requirement already satisfied: six>=1.5 in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from python-dateutil>=2.1->jupyter-client>=5.3.4->spyder_kernels==2.0.*) (1.15.0)

Requirement already satisfied: ipython-genutils in /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages (from traitlets>=4.1.0->ipykernel>=5.3.0->spyder_kernels==2.0.*) (0.2.0)


yfprojects

unread,
Jun 9, 2021, 9:22:44 AM6/9/21
to spyder
What did you enter in the Spyder settings as file path to the python interpreter?

Kind regards
yfprojects

Alper

unread,
Jun 9, 2021, 12:45:24 PM6/9/21
to spyd...@googlegroups.com
/usr/bin/python3



You received this message because you are subscribed to a topic in the Google Groups "spyder" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spyderlib/XirY5YU6Xns/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spyderlib+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyderlib/0644b350-57f1-4e5e-8300-c9467f8cba67n%40googlegroups.com.

Alper

unread,
Jun 9, 2021, 6:23:15 PM6/9/21
to spyd...@googlegroups.com
Hi guys,

Thanks for all the help.... I had to remove everything related to spyder, python, anaconda... reinstall everything and the setting was "/usr/local/bin/python3" and it start to work as expected.

Thanks again.


Reply all
Reply to author
Forward
0 new messages