3

I have had trouble setting up the pycharm ide on my macosx10.7 with python3..

I have scoured every resource available and tried hundreds of approaches, at this point I must accept my incompetence and seek help via this channel.

In my research, I notice a lack of ground-up explanations on python integration into macosx and how to configure pycharm to import modules, run code within the editor, etc. If i ever solve this I will make a very detailed tutorial.

I have imported python3 successfully, it looks like it is linked appropriately from /sys/lib/frameworks to /usr/lib ...etc -- version control is working just fine.

I think my issue is either in setting environmental variables (tried the program to fix this and tried macports) and in the script needed to execute. it will catch errors throughout but final product does not run in python and returns printout of :

/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/pythonpractice/Py_Ex/classes.py

Process finished with exit code 0

i really need to get this configuration sound for my python programming class. please help (I've been through every line of pycharm website) .. preferably is there a way to map it via terminal? thanks for anyone who took the time to read this.

halfelf
  • 9,737
  • 13
  • 54
  • 63
Cory Brown
  • 63
  • 1
  • 7
  • or honestly any successful config.. I've had this problem with aptana /wingware / komodo .... i just need to find my error any ide will work at this point – Cory Brown Apr 09 '12 at 20:03
  • 1
    i keep erring at run configuration error --> please specify script name... what script is used here? – Cory Brown Apr 09 '12 at 20:08
  • I'm sorry to comment so often as i understand its frowned upon and will not happen again, i just need to include this error log to get a good answer : Either do the specified parameters not match any of the following constructors: Either do the specified parameters not match any of the following constructors: [edu.jetbrains.completionWithLiveTemplates.LiveTemplatesCompletionContributor()] or the constructors were not accessible for 'class edu.jetbrains.completionWithLiveTemplates.LiveTemplatesCompletionContributor': Either do the specified parameters not match any of the following co – Cory Brown Apr 09 '12 at 21:07
  • The last error you have comes from the third-party plug-in `Extended Code Sense`. Uninstall it in Preferences | Plugins. Provide the sample script to reproduce the problem, the error you get when running from Terminal, the error you get when running from PyCharm. – CrazyCoder Apr 10 '12 at 11:40
  • words don't encompass how grateful I am for the response ::: run output from pycharm : /Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Applications/PyCharm.app/helpers/run_coverage.py run --omit=/Applications/PyCharm.app/helpers /Users/anon/PycharmProjects/Python3/program1.py Process finished with exit code 0 – Cory Brown Apr 10 '12 at 12:41
  • Try running without coverage. – CrazyCoder Apr 10 '12 at 12:41
  • on run graphics pycharm output : words can't encompass how grateful i am for this response -- i think that was 50% of the problem still tried to runs graphics module :: pycharm output ; /Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 56739 --file /Users/anon/Desktop/graphics.py Traceback (most recent call last): File "/Applications/PyCharm.app/helpers/pydev/pydev_imports.py", line 20, in execfile=execfile #Not in Py3k NameError: name 'execfile' is not defined – Cory Brown Apr 10 '12 at 12:56
  • alright without coverage just outputs :/Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/Desktop/graphics.py --- im so lost inside all the configs I've tweaked forgive me for any ignorant responses – Cory Brown Apr 10 '12 at 12:59
  • i think its trying to run through broken path too pydev – Cory Brown Apr 10 '12 at 13:00
  • pycharm is successfully running anything that doesnt require an import – Cory Brown Apr 10 '12 at 13:06
  • this may be somewhat revealing but on pycharm run, the python launcher that come stock with IDLE launches, on force quit the error is as follows : http://pastebin.com/F9h6Yx6e – Cory Brown Apr 10 '12 at 13:10
  • Can you finally post the source code that doesn't run to your original question? Make sure to use markup for the source code. What modules does your code depend on? Did you install them for this Python interpreter? If so, how did you install them? Do they depend on any native libraries? Which libraries? Are you sure the modules you want to use are compatible with Python 3? Does your code run fine outside of PyCharm? Did you modify PYTHONPATH environment variable? Can you post it? – CrazyCoder Apr 10 '12 at 13:11
  • how do i disable django debug cause its looking there for modules versus within the python3.2 folder – Cory Brown Apr 10 '12 at 15:01
  • this may be useful : 11:32:44 AM Tests passed 11:33:04 AM Tests passed 11:33:26 AM Error running Unittests in DummyTest.test_nothing: Coverage is not importable in this environment. Please install coverage.py to selected interpreter or enable 'Use bundled coverage' in Settings | Coverage 11:34:12 AM Tests passed 11:34:19 AM Tests passed 11:34:29 AM Tests passed 11:34:32 AM Unable to attach test reporter to test framework or test framework quit unexpectedly – Cory Brown Apr 10 '12 at 15:35
  • Use **Run** for scripts, not Debug, not Run with Coverage, also your PYTHONPATH is incorrect. – CrazyCoder Apr 10 '12 at 15:37
  • what should python path be set to?? and pycharm runs any code that doesnt have imports, thanks so much for helping me narrow this down. any suggestions for import process? the files are in the python3.2 /library folder in frameworks.. or so i assume cause thats how idle knows to search fro imports – Cory Brown Apr 10 '12 at 15:45
  • Please record a screencast showing your PyCharm Python interpreter settings with paths, your script, Run configuration, the result of running the script from PyCharm and from the command line, use this: http://screenr.com. – CrazyCoder Apr 10 '12 at 16:21
  • may have to fullscreen it : http://www.clbrown.stu.cofc.edu/pythonfix.mp4 – Cory Brown Apr 10 '12 at 21:17
  • Your Python 3.2 installation paths are not recognized correctly, compare your Paths with the paths of 2.7.1: http://o7.no/HzfhhL or ActiveSate Python 3.2 installation: http://o7.no/IpwFqw. See that import works and code runs (and can be debugged): http://o7.no/HqtVH0. – CrazyCoder Apr 10 '12 at 21:29
  • alright i configured all, except my /site-packages folder does not have a setup tools option. import sys print shows /Library/Frameworks/Python.framework/Versions/3.2/bin/python3.2 /Users/anon/PycharmProjects/Python3/test.py Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/io.py", line 60, in Process finished with exit code 134 – Cory Brown Apr 10 '12 at 23:08
  • then python quits with this error from mac http://pastebin.com/UNbD93az – Cory Brown Apr 10 '12 at 23:17
  • debug output = /Library/Frameworks/Python.framework/Versions/3.2/bin/python3 /Applications/PyCharm.app/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 52106 --file /Users/anon/PycharmProjects/Python3/program1.py Traceback (most recent call last): File "/Applications/PyCharm.app/helpers/pydev/pydev_imports.py", line 20, in execfile=execfile #Not in Py3k NameError: name 'execfile' is not defined During handling of the above exception, another exception occurred: – Cory Brown Apr 11 '12 at 02:04
  • Traceback (most recent call last): File "/Applications/PyCharm.app/helpers/pydev/pydevd.py", line 2, in from django_debug import DjangoLineBreakpoint File "/Applications/PyCharm.app/helpers/pydev/django_debug.py", line 3, in from pydevd_comm import CMD_SET_BREAK File "/Applications/PyCharm.app/helpers/pydev/pydevd_comm.py", line 81, in import pydevd_vars File "/Applications/PyCharm.app/helpers/pydev/pydevd_vars.py", line 10, in import pydevconsole – Cory Brown Apr 11 '12 at 02:04
  • File "/Applications/PyCharm.app/helpers/pydev/pydevconsole.py", line 34, in from pydev_console_utils import BaseInterpreterInterface File "/Applications/PyCharm.app/helpers/pydev/pydev_console_utils.py", line 1, in from pydev_imports import xmlrpclib File "/Applications/PyCharm.app/helpers/pydev/pydev_imports.py", line 22, in from _pydev_execfile import execfile ImportError: cannot import name execfile – Cory Brown Apr 11 '12 at 02:05
  • Your Python installation is probably broken, try to install ActiveState Python from scratch, then remove it from PyCharm, then add it again. All the paths should be detected automatically. The errors you post above make no sense, I told you to use Run, not Debug or other options to verify that it works, investigating Debug problem would be the next step. – CrazyCoder Apr 11 '12 at 06:55
  • 'run' output is right above the paste bin of the Mac kernel error after the 'run' failed .. below i listed output from debug selection. Should I delete all python 3.2 from my system, then reinstall active state python? And I should not touch anything from the python2 versions? – Cory Brown Apr 11 '12 at 12:11
  • Yes, make a vanilla Python 3.2.2 installation and see if it works better. – CrazyCoder Apr 11 '12 at 12:31
  • alright sweet, heres run output, i think perhaps this indicated success: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3 /Users/anon/PycharmProjects/Python3/test.py ['/Users/anon/PycharmProjects/Python3', '/Library/Frameworks/Python.framework/Versions/3.2/lib/python32.zip', '/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2', '/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/lib-dynload', – Cory Brown Apr 11 '12 at 12:45
  • '/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages', '/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/setuptools-0.6c11-py3.2.egg-info'] Process finished with exit code 0 – Cory Brown Apr 11 '12 at 12:45
  • there was another 3.2 installation in a different location, i think i ran the step script for it and befuddled the whole locate 3.2 process? – Cory Brown Apr 11 '12 at 12:46
  • still cannot find graphics module, i think its printing(sys) correctly though am i correct? – Cory Brown Apr 11 '12 at 12:47
  • /Library/Frameworks/Python.framework/Versions/3.2/bin/python3 /Users/anon/PycharmProjects/Python3/button.py Traceback (most recent call last): File "/Users/anon/PycharmProjects/Python3/button.py", line 2, in import graphics ImportError: No module named graphics Process finished with exit code 1 – Cory Brown Apr 11 '12 at 12:48
  • Did you add `graphics.py` to your project or to the `PYTHONPATH`? It's not something standard that is available out of the box with any Python installation, so you need to install it separately or have in your project. – CrazyCoder Apr 11 '12 at 12:53
  • python interpreter config matches your jpeg from yesterday exactly. heres my edit config, i think yesterday you mentioned environment variable was incorrect : http://www.clbrown.stu.cofc.edu/screenshot.png – Cory Brown Apr 11 '12 at 12:55
  • oh I see, should i drag it directly into the /usr/pycharm/projects/python3 or do I add it to 3.2 interpreter? – Cory Brown Apr 11 '12 at 12:56
  • If you want your project to run on other systems it's better to keep this file in the project, otherwise you will have to install it on the other machines as well. – CrazyCoder Apr 11 '12 at 12:59
  • got it, It worked beautifully. I am forever indebted to you sir. I will spread word of the help you rendered me and attempt to have the entire computer science dept purchase your product. Can u give me a quick rundown of your debut config, I noticed your 2.7 had a env-var set in the interpreter options, mine always crashes through pydev directory. – Cory Brown Apr 11 '12 at 13:04
  • Here it is: http://o7.no/I2v4Wi – CrazyCoder Apr 11 '12 at 13:18
  • thanks so much, you've saved me grade the past 48 hours. Will organize what we covered here into a concise troubleshooting tutorial, half my python class is following the assistance you rendered us and they extend their thanks as well. – Cory Brown Apr 11 '12 at 13:24
  • i think perhaps pydev requires porting to 3.2 – Cory Brown Apr 11 '12 at 13:31
  • is this whats required (macport installation) http://www.insomnihack.com/?paged=2 – Cory Brown Apr 11 '12 at 13:34
  • Any Python version compatible with Mac should work, but I was trying it with ActiveState Python as it's easier to setup. – CrazyCoder Apr 11 '12 at 13:38
  • k where else can i find debugger options, because my edit config is identical to yours however same crash within the pyDev part of it – Cory Brown Apr 11 '12 at 13:47
  • What PyCharm version do you use? It works fine out of the box with PyCharm 2.0.2, I didn't configure any options. Maybe your Python installation is still broken or Python interpreter in PyCharm is not configured properly, try to reinstall PyCharm, then delete the following directories: `~/Library/Preferences/PyCharm20`, `~/Library/Caches/PyCharm20`, `~/Library/Application Support/PyCharm20`. Start PyCharm with all the default settings, configure Python interpreter from scratch, try to debug again. – CrazyCoder Apr 11 '12 at 13:53
  • ok should i follow the version control steps presented at start of pycharm installation? – Cory Brown Apr 11 '12 at 14:15
  • There are no such steps, there should be a dialog for the plug-ins configuration which you can skip. – CrazyCoder Apr 11 '12 at 14:20
  • when i select my python3 distribution for interpreter. Should i go into the /bin and select python3.2, or python3 (i noticed yours was python3) or should i select the first /python.exec that sits outside the version folder but within python.frameworks alongside /headers /versions /resources. – Cory Brown Apr 11 '12 at 15:13
  • `/Library/Frameworks/Python.framework/Versions/3.2/bin/python3` – CrazyCoder Apr 11 '12 at 16:13
  • works perfectly, both run and python debug.. thank you! – Cory Brown Apr 11 '12 at 16:51

1 Answers1

4

Summary of the discussion above:

  • Python 3.2.2 installation was broken on this Mac, installing ActiveState Python 3.2.2 from scratch and configuring it in PyCharm has fixed the problem.

  • Python path to be used in PyCharm settings: /Library/Frameworks/Python.framework/Versions/3.2/bin/python3

  • Incompatible third-party plug-ins may break PyCharm, uninstall/disable them in Preferences | Plugins.

  • Ensure the latest PyCharm version is installed.

  • User's code depends on the graphics.py module which was not in the project or in the PYTHONPATH. Putting it into the project has solved the problem.

  • Most likely the wrong Run/Debug configuration was used in PyCharm, the easiest way to run or debug such scripts is by using the editor context menu Run and Debug actions. PyCharm creates the configuration automatically and debugging works fine as shown of the screenshot:

debugging

  • If one wants to configure and debug it, he can use the code.zip file to get started.

Sorry for the comments mess above, but it was not possible to move it into chat as user had only 1 reputation point, hence not able to use the chat feature of StackOverflow.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • PyCharm 2.5+ supports Python [virtual environments](http://www.jetbrains.com/pycharm/whatsnew/index.html) which should make life easier. – Burhan Khalid Jun 24 '12 at 11:55
  • Yes, but not in this case. Somebody should explain **@Cory Brown** how to accept answers. – CrazyCoder Jun 24 '12 at 12:00
  • @crazycoder, if you are still around, would you like to help me with this question? http://stackoverflow.com/questions/37638453/setup-kivy-anaconda-with-pycharm-ide-on-osx – Reblochon Masque Jun 09 '16 at 14:54
  • 1
    @ReblochonMasque please contact PyCharm support at https://intellij-support.jetbrains.com/hc/ – CrazyCoder Jun 10 '16 at 12:02