Hey all. I can't figure out what exactly is going on with my python install. I've tried installing twisted on both mac leopard and tiger. It installs fine, but when I try to run a basic twisted.web http server. I get errors about the web module not existing.
It seems like some load path issues. I've tried numerous different hacks on the load path just to get it at least loading. but to no avail. does anyone else have crazy problems like this?
By default twisted was being installed here: /Library/Python/2.3/site-packages/twisted I've tried putting twisted in :/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python/twisted
I've also tried some things with the interpreter.
$>python
import twisted
Traceback (most recent call last): File "<stdin>", line 1, in ? File "twisted.py", line 1, in ? from twisted.web import http ImportError: No module named web
----------------- $>python
import sys sys.path = ["/Library/Python/2.3/site-packages/twisted"] import twisted import twisted.web
Traceback (most recent call last): File "<stdin>", line 1, in ? ImportError: No module named web
I'm really stuck. dah! Any ideas?
Thanks
Run this:
import sys print sys.path
------ ['', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python']
cd Library/Python/2.3/site-packages/ $ python
import twisted
-------------
import twisted.web
I've tried what you suggested previously with the PYTHONPATH as well. It still works partially, but then fails on zope.interface. (which I did install). It just seems like there are some crazy complications that I can't figure out. dah!
thanks for help man.
On Nov 8, 2007 12:00 PM, Dmitry Kozhevin dmitrikozhevin@gmail.com wrote:
ImportError: No module named web
Run this:
import sys print sys.path
And email me what you get.
And one more, cd Library/Python/2.3/site-packages/ $ python
import twisted
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On 9 Nov, 2007, at 0:58, aaron smith wrote:
Run this:
import sys print sys.path
['', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/ python']
cd Library/Python/2.3/site-packages/ $ python
import twisted
import twisted.web
I've tried what you suggested previously with the PYTHONPATH as well. It still works partially, but then fails on zope.interface. (which I did install). It just seems like there are some crazy complications that I can't figure out. dah!
thanks for help man.
On with system was this, 10.4 or 10.5? On Leopard the default python install is Python 2.5.1, which doesn't match the list above.
The TwistedCore is part of the default install in Leopard, TwistedWeb is not. Do you perhaps have multiple Python installations? This could cause the problems you're seeing, maybe the the python on your shells PATH is not the one you're expected.
Check the output of "which python" to make sure (or print sys.executable on the python prompt).
Ronald
On Nov 8, 2007 12:00 PM, Dmitry Kozhevin dmitrikozhevin@gmail.com wrote:
ImportError: No module named web
Run this:
import sys print sys.path
And email me what you get.
And one more, cd Library/Python/2.3/site-packages/ $ python
import twisted
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
I've tried this on Mac Tiger and mac Leopard. To no avail. On Tiger it had the same issues, versions / to many python locations..
My default machine is leopard.
My python executable is here: /usr/bin/python
It seems like there are too many installations or something. would it be problematic to remove mac's default python and just re-install it all myself? It seems there are issues with all these python files all over the place.
so far there are: /usr/bin/python /usr/lib/python2.5 /Library/Python/2.5 /Library/Python/2.3 /System/Library/Frameworks/Python.framework
Thanks
On Nov 8, 2007 9:20 PM, Ronald Oussoren ronaldoussoren@mac.com wrote:
On 9 Nov, 2007, at 0:58, aaron smith wrote:
Run this:
import sys print sys.path
['', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/ python']
cd Library/Python/2.3/site-packages/ $ python
import twisted
import twisted.web
I've tried what you suggested previously with the PYTHONPATH as well. It still works partially, but then fails on zope.interface. (which I did install). It just seems like there are some crazy complications that I can't figure out. dah!
thanks for help man.
On with system was this, 10.4 or 10.5? On Leopard the default python install is Python 2.5.1, which doesn't match the list above.
The TwistedCore is part of the default install in Leopard, TwistedWeb is not. Do you perhaps have multiple Python installations? This could cause the problems you're seeing, maybe the the python on your shells PATH is not the one you're expected.
Check the output of "which python" to make sure (or print sys.executable on the python prompt).
Ronald
On Nov 8, 2007 12:00 PM, Dmitry Kozhevin dmitrikozhevin@gmail.com wrote:
ImportError: No module named web
Run this:
import sys print sys.path
And email me what you get.
And one more, cd Library/Python/2.3/site-packages/ $ python
import twisted
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On 11 Nov, 2007, at 1:10, aaron smith wrote:
I've tried this on Mac Tiger and mac Leopard. To no avail. On Tiger it had the same issues, versions / to many python locations..
My default machine is leopard.
My python executable is here: /usr/bin/python
It seems like there are too many installations or something. would it be problematic to remove mac's default python and just re-install it all myself?
Yes. Don't remove Apple's copy of python, it is used by the OS itself and 3th party applications rely on it being there.
Multiple python installations on a single machine are perfectly safe, although it can be confusing when you don't know about all of them and you accicently invoke a different version of python that you thought you would.
It seems there are issues with all these python files all over the place.
so far there are: /usr/bin/python /usr/lib/python2.5
This are part of the system install
/Library/Python/2.5 /Library/Python/2.3
These are site-packages directorys for python 2.3 and python 2.5
/System/Library/Frameworks/Python.framework
This is the system install of python and contains the installations for python 2.5 and 2.3 (the former is not present on 10.3).
Other common locations of a python installation are /Library/ Frameworks/Python.framework (the python.org distribution of python, as well as ActiveState's python), /opt/local/bin (MacPorts) and /sw/bin (Fink).
Ronald
Thanks
On Nov 8, 2007 9:20 PM, Ronald Oussoren ronaldoussoren@mac.com wrote:
On 9 Nov, 2007, at 0:58, aaron smith wrote:
Run this:
> import sys > print sys.path
['', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python23.zip', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.3/Extras/ lib/ python']
cd Library/Python/2.3/site-packages/ $ python
> import twisted
import twisted.web
I've tried what you suggested previously with the PYTHONPATH as well. It still works partially, but then fails on zope.interface. (which I did install). It just seems like there are some crazy complications that I can't figure out. dah!
thanks for help man.
On with system was this, 10.4 or 10.5? On Leopard the default python install is Python 2.5.1, which doesn't match the list above.
The TwistedCore is part of the default install in Leopard, TwistedWeb is not. Do you perhaps have multiple Python installations? This could cause the problems you're seeing, maybe the the python on your shells PATH is not the one you're expected.
Check the output of "which python" to make sure (or print sys.executable on the python prompt).
Ronald
On Nov 8, 2007 12:00 PM, Dmitry Kozhevin dmitrikozhevin@gmail.com wrote:
ImportError: No module named web
Run this:
> import sys > print sys.path
And email me what you get.
And one more, cd Library/Python/2.3/site-packages/ $ python
> import twisted
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web