4

I am trying to install PyX in yosemite under python 2.7.6

Initially, the setup looks ok

 python setup.py  install
running install
running build
running build_py
running install_lib
running install_egg_info
Removing /Users/alkaloge/Library/Python/2.7/site-packages/PyX-0.12.1-py2.7.egg-info
Writing /Users/alkaloge/Library/Python/2.7/site-packages/PyX-0.12.1-py2.7.egg-info

but when trying to run an example

 python hello.py 
Traceback (most recent call last):
  File "hello.py", line 1, in <module>
    from pyx import *
ImportError: No module named pyx

Any help ?

thanks

woot
  • 7,406
  • 2
  • 36
  • 55
Just_Newbie
  • 447
  • 1
  • 4
  • 11
  • At the command line, type `cd` to go to your home directory, type `python` to start the interpreter, then run `import sys; print(sys.path)`. What are the results of that command? – MattDMo Jan 13 '15 at 17:53
  • `['/Users/alkaloge/root/lib', '/Users/alkaloge', '/Users/alkaloge/Library/Python/2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',` – Just_Newbie Jan 13 '15 at 20:13
  • `'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']` – Just_Newbie Jan 13 '15 at 20:15
  • Had to put two comments to include all – Just_Newbie Jan 13 '15 at 20:15
  • If you run `ls ~/Library/Python/2.7/site-packages`, which entries (if any) matching `pyx*` or `PyX*` or similar are there? – MattDMo Jan 13 '15 at 20:58
  • `ls ~/Library/Python/2.7/site-packages PyX-0.12.1-py2.7.egg-info pip-6.0.6-py2.7.egg setuptools-11.3.1-py2.7.egg test-easy-install-27332.write-test easy-install.pth pyx ` – Just_Newbie Jan 13 '15 at 21:18
  • OK, so `pyx` is there. Try restarting Terminal completely and see if the import works now. There's no reason it shouldn't... – MattDMo Jan 13 '15 at 21:19
  • hey, I thought about this as well, but this does not solve it.... – Just_Newbie Jan 13 '15 at 21:53

1 Answers1

-2

Make sure, this is a common problem, your Command Line Interface is using the appropriate version of Python. Most users have multiple versions of python installed, and your CLI only recognizes one at at time. In your terminal window type in python and you will see what version you have. Also check where you installed PyX if it isn't under another python directory.

macas
  • 67
  • 1
  • 9
  • this is a comment, not an answer to the question – MattDMo Jan 13 '15 at 20:53
  • This is the answer. Not a comment. If you have something better, please don't let me stop you from commenting. – macas Jan 13 '15 at 20:55
  • trouble is, all the information is included in the question and comments. OP is using Python 2.7, and `sys.path` includes the directory where pyx was installed – MattDMo Jan 13 '15 at 20:56