Configuring Python environment shipped with 3rd party software (MySQL Workbench 6.1)

Hello,

I have just downloaded PyCharm as my first Python IDE. I felt it was the logical choice after having switched from Eclipse to IntelliJ a few weeks ago. ;-)

Anyways, I have problems configuring the Python interpreter that is shipped with MySQL Workbench 6.1. You can get it here BTW: http://dev.mysql.com/downloads/tools/workbench/

The python.exe is located in the Workbench install dir, absolute path is C:/Program Files (x86)/MySQL/MySQL Workbench 6.1 CE/python.exe

When going to the Python Interpreters settings page and entering a new Python interpreter via the green plus button, I get the error box saying "Invalid Python SDK":

py-invalid-sdk.png

The interpreter will stay in the list however. Then below I recognized a link trying to set up a virtual environment:

py-ve-dialog.png

Pressing OK then results in another error box:

py-import-error.png

I really feel kind of confused what to do here. I have never worked in a "real" Python environment, so I have no idea what might be missing. Maybe some environment variables?

How do I generally find my way around to solve such things?

Any help on how to integrate the MySQL Workbench Python interpeter into PyCharm would be greatly appreciated.

Thanks
Kawu

PS: probably related: http://stackoverflow.com/questions/22623011/whats-the-structure-of-a-valid-python-sdk
2 comments
Comment actions Permalink
The solution was to add the environment variable PYTHONPATH=C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\python\lib and add C:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE to the PATH variable.
0
Comment actions Permalink
This didn't help.
echo %PYTHONPATH%

C:\Python27;C:\Python27\Lib;C:\Python27\Lib\site-packages

echo %PATH%

...;C:\Python27;C:\Python27\Scripts

In PyCharms Settings / Project Interpreter / Python Interpreters

Python 2.7.5 (C:/Python27/python.exe) set as interpreter


Paths:

C:/Python27/DLLs
C:/Python27/Lib
C:/Python27/Lib/lib-tk
C:/Python27
C:/Python27/Lib/site-packages
C:/Python27/Lib/site-packages/PIL
C:/Python27/Lib/site-packages/win32
C:/Python27/Lib/site-packages/win32/lib
C:/Python27/Lib/site-packages/pythonwin
C:/Python27/Lib/site-packages/setuptools-2.2-py2.7.egg!/
C:/Program Files/JetBrains/PyCharm Community Edition 3.0/helpers/python-skeletons


When running the project in PyCharm:

import sys
print sys.path

'C:\\Python27\\Lib',
'C:\\Python27\\DLLs',
'C:\\Python27\\python27.zip',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27\\lib\\site-packages',
'C:\\Python27\\lib\\site-packages\\PIL',
'C:\\Python27\\lib\\site-packages\\win32',
'C:\\Python27\\lib\\site-packages\\win32\\lib',
'C:\\Python27\\lib\\site-packages\\Pythonwin',
'C:\\Python27\\lib\\site-packages\\setuptools-2.2-py2.7.egg',

I can see

'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27\\lib\\XXX

here , but it should be

C:\\Python27\\Lib

I am not sure if lower-/uppercase are here respected.

However as you can notice above in Interpreter's path there is proper path:

C:/Python27/Lib


EDIT:

I've changed lowercase lib to Lib in PYTHONPATH environment variable using control panel.

print sys.path gives now:

'C:\\Python27\\Lib',
'C:\\Python27\\DLLs',
'C:\\Python27\\python27.zip',
'C:\\Python27\\Lib\\plat-win',
'C:\\Python27\\Lib\\lib-tk',
'C:\\Python27\\Lib\\site-packages',
'C:\\Python27\\Lib\\site-packages\\PIL',
'C:\\Python27\\Lib\\site-packages\\win32',
'C:\\Python27\\Lib\\site-packages\\win32\\Lib',
'C:\\Python27\\Lib\\site-packages\\Pythonwin',
'C:\\Python27\\Lib\\site-packages\\setuptools-2.2-py2.7.egg',
'C:\\Python27']

However references to things like object, @staticmethod, len, range can't be found.

Paths seem to be allright, location of interpreter also seems to be allright, but still I am getting this error:
Invalid Project Interpreter: Cannot run the project interpreter. Configure...

with following notification ( no idea if it has something to do with that ):
External file changes sync may be slow: Project files cannot be watched (are they under network mount?)


No idea what to try now.
0

Please sign in to leave a comment.