Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #27261 > unrolled thread
| Started by | wdtate@comcast.net |
|---|---|
| First post | 2012-08-17 12:20 -0700 |
| Last post | 2012-08-18 00:58 +0200 |
| Articles | 12 — 3 participants |
Back to article view | Back to comp.lang.python
Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 12:20 -0700
Re: Python 2.7 import socket urllib fails to load, module not found Emile van Sebille <emile@fenx.com> - 2012-08-17 12:39 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 13:41 -0700
Re: Python 2.7 import socket urllib fails to load, module not found Emile van Sebille <emile@fenx.com> - 2012-08-17 13:57 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 14:15 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 14:22 -0700
Re: Python 2.7 import socket urllib fails to load, module not found Emile van Sebille <emile@fenx.com> - 2012-08-17 15:40 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 14:22 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 14:15 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 13:41 -0700
Re: Python 2.7 import socket urllib fails to load, module not found wdtate@comcast.net - 2012-08-17 14:21 -0700
Re: Python 2.7 import socket urllib fails to load, module not found Christian Heimes <lists@cheimes.de> - 2012-08-18 00:58 +0200
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 12:20 -0700 |
| Subject | Python 2.7 import socket urllib fails to load, module not found |
| Message-ID | <22db6f61-180c-47ce-a0c3-3315b40b8315@googlegroups.com> |
Just installed python 2.7 and using with web2py. When running python from command line to bring up web2py server, get errors that python socket and urllib modules cannot be found, can't be loaded. This is not a web2py issue. No other python versions are on the my machine. Pythonpath has the requisite folders identified. Would appreciate any insights as to what may be happening. thanks in advance
[toc] | [next] | [standalone]
| From | Emile van Sebille <emile@fenx.com> |
|---|---|
| Date | 2012-08-17 12:39 -0700 |
| Message-ID | <mailman.3429.1345232370.4697.python-list@python.org> |
| In reply to | #27261 |
On 8/17/2012 12:20 PM wdtate@comcast.net said... > Just installed python 2.7 and using with web2py. > > When running python from command line to bring up web2py server, get errors that python socket and urllib modules cannot be found, can't be loaded. This is not a web2py issue. > So, on my system I get: ActivePython 2.7.0.2 (ActiveState Software Inc.) based on Python 2.7 (r27:82500, Aug 23 2010, 17:18:21) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import urllib >>> import socket >>> What does your system show? Emile > No other python versions are on the my machine. Pythonpath has the requisite folders identified. > > Would appreciate any insights as to what may be happening. > > thanks in advance >
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 13:41 -0700 |
| Message-ID | <1726c197-b2bb-47d8-982f-9f26af1e310d@googlegroups.com> |
| In reply to | #27262 |
>
> So, on my system I get:
>
> ActivePython 2.7.0.2 (ActiveState Software Inc.) based on
>
> Python 2.7 (r27:82500, Aug 23 2010, 17:18:21) [MSC v.1500 32 bit
>
> (Intel)] on win32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import urllib
>
> >>> import socket
>
> >>>
>
>
>
> What does your system show?
>
>
>
> Emile
>
From cmd prompt - I get this:
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\urllib.py", line 26, in <module>
import socket
File "C:\Python27\lib\socket.py", line 47, in <module>
import _socket
ImportError: DLL load failed: The specified module could not be found
I also get that if I attempt to import socket.
NOTE this does not happen when I'm in the pythonwin IDE.
[toc] | [prev] | [next] | [standalone]
| From | Emile van Sebille <emile@fenx.com> |
|---|---|
| Date | 2012-08-17 13:57 -0700 |
| Message-ID | <mailman.3432.1345237052.4697.python-list@python.org> |
| In reply to | #27263 |
On 8/17/2012 1:41 PM wdtate@comcast.net said...
>>From cmd prompt - I get this:
> Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import urllib
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "C:\Python27\lib\urllib.py", line 26, in <module>
> import socket
> File "C:\Python27\lib\socket.py", line 47, in <module>
> import _socket
> ImportError: DLL load failed: The specified module could not be found
>
> I also get that if I attempt to import socket.
>
> NOTE this does not happen when I'm in the pythonwin IDE.
>
So, try the following in both environments:
import sys
for ii in sys.path: print ii
You'll likely find diffferences between the two.
In the pythonwin environment, try:
import socket
print socket.__file__
Chances are the __file__'s directory isn't in the command line's sys.path.
Emile
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 14:15 -0700 |
| Message-ID | <mailman.3433.1345238143.4697.python-list@python.org> |
| In reply to | #27266 |
> > So, try the following in both environments: > import sys > for ii in sys.path: print ii > > You'll likely find diffferences between the two. > In the pythonwin environment, try: > > > > import socket > > print socket.__file__ > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > Emile Done - tail end of the python path had a missing bit...grrrrr... thanks so much
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 14:22 -0700 |
| Message-ID | <ab893bbe-9928-4cfb-a911-92f813413abb@googlegroups.com> |
| In reply to | #27267 |
On Friday, August 17, 2012 5:15:35 PM UTC-4, (unknown) wrote: > > > > > So, try the following in both environments: > > > import sys > > > for ii in sys.path: print ii > > > > > > You'll likely find diffferences between the two. > > > > > In the pythonwin environment, try: > > > > > > > > > > > > import socket > > > > > > print socket.__file__ > > > > > > > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > > > > > > > > > Emile > > > > Done - tail end of the python path had a missing bit...grrrrr... thanks so much Well it's bizarre - now it doesn't. did an import sys from within interpreter, then did import socket. Worked the first time. Restarted and it happened again. The sys.path outputs are identical. The print socket.__file__ reveals a file that is in the sys.path...grrrr. On Friday, August 17, 2012 5:15:35 PM UTC-4, (unknown) wrote: > > > > > So, try the following in both environments: > > > import sys > > > for ii in sys.path: print ii > > > > > > You'll likely find diffferences between the two. > > > > > In the pythonwin environment, try: > > > > > > > > > > > > import socket > > > > > > print socket.__file__ > > > > > > > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > > > > > > > > > Emile > > > > Done - tail end of the python path had a missing bit...grrrrr... thanks so much On Friday, August 17, 2012 5:15:35 PM UTC-4, (unknown) wrote: > > > > > So, try the following in both environments: > > > import sys > > > for ii in sys.path: print ii > > > > > > You'll likely find diffferences between the two. > > > > > In the pythonwin environment, try: > > > > > > > > > > > > import socket > > > > > > print socket.__file__ > > > > > > > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > > > > > > > > > Emile > > > > Done - tail end of the python path had a missing bit. Corrected that. the sys.path outputs match but I still have the same problem. print socket.__file__ produces a path that is in the pythonpath.
[toc] | [prev] | [next] | [standalone]
| From | Emile van Sebille <emile@fenx.com> |
|---|---|
| Date | 2012-08-17 15:40 -0700 |
| Message-ID | <mailman.3436.1345243280.4697.python-list@python.org> |
| In reply to | #27270 |
On 8/17/2012 2:22 PM wdtate@comcast.net said... >> Done - tail end of the python path had a missing bit...grrrrr... thanks so much > > Well it's bizarre - now it doesn't. did an import sys from within interpreter, then did import socket. Worked the first time. Restarted and it happened again. The sys.path outputs are identical. The print socket.__file__ reveals a file that is in the sys.path...grrrr. > Next, I'd check for rogue versions of _socket.pyd in directories occuring in sys.path. Emile
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 14:22 -0700 |
| Message-ID | <mailman.3434.1345238561.4697.python-list@python.org> |
| In reply to | #27267 |
On Friday, August 17, 2012 5:15:35 PM UTC-4, (unknown) wrote: > > > > > So, try the following in both environments: > > > import sys > > > for ii in sys.path: print ii > > > > > > You'll likely find diffferences between the two. > > > > > In the pythonwin environment, try: > > > > > > > > > > > > import socket > > > > > > print socket.__file__ > > > > > > > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > > > > > > > > > Emile > > > > Done - tail end of the python path had a missing bit...grrrrr... thanks so much Well it's bizarre - now it doesn't. did an import sys from within interpreter, then did import socket. Worked the first time. Restarted and it happened again. The sys.path outputs are identical. The print socket.__file__ reveals a file that is in the sys.path...grrrr. On Friday, August 17, 2012 5:15:35 PM UTC-4, (unknown) wrote: > > > > > So, try the following in both environments: > > > import sys > > > for ii in sys.path: print ii > > > > > > You'll likely find diffferences between the two. > > > > > In the pythonwin environment, try: > > > > > > > > > > > > import socket > > > > > > print socket.__file__ > > > > > > > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > > > > > > > > > Emile > > > > Done - tail end of the python path had a missing bit...grrrrr... thanks so much On Friday, August 17, 2012 5:15:35 PM UTC-4, (unknown) wrote: > > > > > So, try the following in both environments: > > > import sys > > > for ii in sys.path: print ii > > > > > > You'll likely find diffferences between the two. > > > > > In the pythonwin environment, try: > > > > > > > > > > > > import socket > > > > > > print socket.__file__ > > > > > > > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > > > > > > > > > Emile > > > > Done - tail end of the python path had a missing bit. Corrected that. the sys.path outputs match but I still have the same problem. print socket.__file__ produces a path that is in the pythonpath.
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 14:15 -0700 |
| Message-ID | <c1db9ab9-5b47-427f-8146-0fcc8edc7414@googlegroups.com> |
| In reply to | #27266 |
> > So, try the following in both environments: > import sys > for ii in sys.path: print ii > > You'll likely find diffferences between the two. > In the pythonwin environment, try: > > > > import socket > > print socket.__file__ > > > Chances are the __file__'s directory isn't in the command line's sys.path. > > > > Emile Done - tail end of the python path had a missing bit...grrrrr... thanks so much
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 13:41 -0700 |
| Message-ID | <mailman.3430.1345236100.4697.python-list@python.org> |
| In reply to | #27262 |
>
> So, on my system I get:
>
> ActivePython 2.7.0.2 (ActiveState Software Inc.) based on
>
> Python 2.7 (r27:82500, Aug 23 2010, 17:18:21) [MSC v.1500 32 bit
>
> (Intel)] on win32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import urllib
>
> >>> import socket
>
> >>>
>
>
>
> What does your system show?
>
>
>
> Emile
>
>From cmd prompt - I get this:
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\urllib.py", line 26, in <module>
import socket
File "C:\Python27\lib\socket.py", line 47, in <module>
import _socket
ImportError: DLL load failed: The specified module could not be found
I also get that if I attempt to import socket.
NOTE this does not happen when I'm in the pythonwin IDE.
[toc] | [prev] | [next] | [standalone]
| From | wdtate@comcast.net |
|---|---|
| Date | 2012-08-17 14:21 -0700 |
| Message-ID | <c18df71e-62b0-4b3d-b1c4-c2cf67dc3e5c@googlegroups.com> |
| In reply to | #27261 |
On Friday, August 17, 2012 3:20:48 PM UTC-4, (unknown) wrote: > Just installed python 2.7 and using with web2py. > > > > When running python from command line to bring up web2py server, get errors that python socket and urllib modules cannot be found, can't be loaded. This is not a web2py issue. > > > > No other python versions are on the my machine. Pythonpath has the requisite folders identified. > > > > Would appreciate any insights as to what may be happening. > > > > thanks in advance
[toc] | [prev] | [next] | [standalone]
| From | Christian Heimes <lists@cheimes.de> |
|---|---|
| Date | 2012-08-18 00:58 +0200 |
| Message-ID | <mailman.3437.1345244346.4697.python-list@python.org> |
| In reply to | #27261 |
Am 17.08.2012 21:20, schrieb wdtate@comcast.net:
> Just installed python 2.7 and using with web2py.
>
> When running python from command line to bring up web2py server, get errors that python socket and urllib modules cannot be found, can't be loaded. This is not a web2py issue.
>
> No other python versions are on the my machine. Pythonpath has the requisite folders identified.
Please show us the output of:
import sys
print sys.version
import platform
print platform.platform()
import imp
print imp.find_module("_socket")
imp.find_module() may either return "_socket" as first argument if the
_socket module is builtin or return the full path to a file. When it's a
full path please install http://www.dependencywalker.com/ and examine
the _socket.pyd file with the tool. It will show you the missing DLLs.
Christian
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web