LionHeart123 / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

Canot Run Scripts on Windows 7 #695

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I am using some standard scripts as part of a MongoDB class- none work in 
PyScripter
2. All work directly in Python from the command line

What is the expected output? What do you see instead?

In this case, the script should print out some simple results from a test 
collection.  Instead I get the following stack trace and a popup error which 
says "exceptions.ImportError: DLL load failed: %1 is not a valid Win32 
application.

File "<string>", line 254, in run_nodebug
  File "C:\data\db\Week2\lesson_files\using_find.py", line 2, in <module>
    import pymongo
  File "C:\Python27\lib\site-packages\pymongo\__init__.py", line 61, in <module>
    from pymongo.connection import Connection
  File "C:\Python27\lib\site-packages\pymongo\connection.py", line 39, in <module>
    import socket
  File "C:\Python27\Lib\socket.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.

What version of the product are you using? On what operating system?

I am using Version 2.5.3.0 x64 on a Windows 7 Professional 64-Bit computer

Original issue reported on code.google.com by kt...@ipghoster.com on 31 Oct 2012 at 8:55

Attachments:

GoogleCodeExporter commented 9 years ago
As the project web page and the installation file says:

  "For compatibility with Python 2.6 and Python 3.0, since version 1.9.9.5, PyScripter requires the latest C++ Redistributable Package(http://www.microsoft.com/en-us/download/details.aspx?id=5582). This is automatically installed by Python 2.6 and Python 3.x. If you do not have any of these versions installed, then you need to download and install it manually."

You are using Python 2.5 and it appears that you do not have this installed.

Original comment by pyscripter on 1 Nov 2012 at 7:46

GoogleCodeExporter commented 9 years ago
I already have the C++ Libraries on my computer but I went ahead and repaired 
them using your link - that did not solve the issues.

Original comment by kt...@ipghoster.com on 2 Nov 2012 at 1:51

GoogleCodeExporter commented 9 years ago
Strange.  It fails on 
import _socket 
which is a standard Python module, and the problem has nothing to do with 
pymongo.  Also I now noticed that you are using Python 2.7, which installs the 
C++ stuff, so my earlier comment would not apply.  

Are you using a standard python 64-bit distribution from python.org?

Original comment by pyscripter on 2 Nov 2012 at 6:05

GoogleCodeExporter commented 9 years ago
Yes - I grabbed the 64-Bit installer for 2.7.3 and ran it using its defaults.  
I also downloaded it again just now and ran it again and let it repair the 
install.  That appears to have corrected this issue.

I did note, however, that trying to run bottle.py, while it does run, causes 
the application to hang.  For example this script runs but PyScripter hangs:

import bottle   #gets the bottle web server framework

@bottle.route('/')  #sets bottle to handle default page requests
def home_page():
    return "Hello World\n"

@bottle.route('/testpage')
def test_page():
    return "This is a test page"

bottle.debug(True)
bottle.run(host='localhost',port=8080)  #Cannot use 80 due to IIS

Original comment by kt...@ipghoster.com on 2 Nov 2012 at 6:21

GoogleCodeExporter commented 9 years ago
Same for me, running Python 2.6 on Windows 7 64bit, the import of socket causes 
an error message, which is very strange, for the normal python functions, only 
the PyScripter interpreter does not, which makes it pretty unusable... The VC 
redist package did not help any.

Original comment by marencin...@gmail.com on 19 Oct 2013 at 3:17

GoogleCodeExporter commented 9 years ago
Installing the 32 bit version solved the issue!

Original comment by marencin...@gmail.com on 19 Oct 2013 at 3:21