Posts: 7
Threads: 1
Joined: Oct 2016
Hello people,
I am pretty new at working with python and I am encoutering the error as stated in the subject. Full error:
Error: Traceback (most recent call last):
File "C:\Users\Joan\workspace2\Model\src\main.py", line 6, in <module>
import lib_pct_build_network
File "C:\Users\Joan\workspace2\Model\src\lib_pct_build_network.py", line 4, in <module>
from lib_pct_read_network import *
File "C:\Users\Joan\workspace2\Model\src\lib_pct_read_network.py", line 5, in <module>
PCTr=CDLL("./LibPCTReadNetwork.so")
File "C:\Users\Joan\Anaconda3\lib\ctypes\__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
I have already googled it and many answers say it is a bit 32bit vs 64bit issue. However I don't know what the problem would be :huh:
I use a 32bit eclipse with PyDev plugin
I have python 3.5 (32 bits)
Windows 7
Is there anything else that should be 32bits? Any help is appreciated :-)
Posts: 1,298
Threads: 38
Joined: Sep 2016
What code are you trying to run? Note that Win32 does not indicate you are running 32 bit code, it is just a label indicating you are using a Windows platform
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 5,042
Threads: 384
Joined: Sep 2016
try running the program from a command line/terminal.
Posts: 7
Threads: 1
Joined: Oct 2016
what exactly do you mean with 32bit code? how can i check how many bits my code is?
for a project i have been provided with a toolbox written in python and i'm trying to import a module from this toolbox (could this toolbox perhaps be 64bits? and if so how can i check?). i have placed all files in the same folder.
Posts: 1,298
Threads: 38
Joined: Sep 2016
Oct-17-2016, 09:53 PM
(This post was last modified: Oct-17-2016, 09:57 PM by sparkz_alot.)
(Oct-17-2016, 09:38 PM)Zest Wrote: what exactly do you mean with 32bit code? how can i check how many bits my code is?
for a project i have been provided with a toolbox written in python and i'm trying to import a module from this toolbox (could this toolbox perhaps be 64bits? and if so how can i check?). i have placed all files in the same folder.
When we ask for your code, it means the Python code you have written. :)
You say you have a 'toolbox' and you are trying to import a module from it, so at the very least, your code will look like this
import module_name # This is the name of the module you are trying to import
# Here is you code that you've written to use that module At this point, do not worry about 32 and 64 bit stuff. Where did you get the 'toolbox' from?
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Posts: 7
Threads: 1
Joined: Oct 2016
alright well the main class looks like this, nothing special, the toolbox was written and provided by someone I know and it isn't public so I should probably not be sharing that without permission :-/
import lib_pct_build_network
if __name__ == '__main__':
pass is there anything you would like to know/see about the toolbox/library?
Posts: 5,086
Threads: 106
Joined: Sep 2016
(Oct-17-2016, 08:55 PM)Zest Wrote: I use a 32bit eclipse with PyDev plugin
I have python 3.5 (32 bits)
Windows 7 When say python 3.5 (32 bits) is this trough anaconda?
Quote:File "C:\Users\Joan\Anaconda3\lib\ctypes\__init__.py", line 347, in __init__
Error: OSError: [WinError 193] %1 is not a valid Win32 application
The error message is because you mixing are 32-bit and 64-bit.
Posts: 7
Threads: 1
Joined: Oct 2016
Oct-17-2016, 10:10 PM
(This post was last modified: Oct-17-2016, 10:14 PM by Zest.)
i ran it in the terminal and a similar error happens:
https://gyazo.com/d62c64801b849bbe9b5205f1e8dc2620
@ snippsat, if it says so in the stack (the quote) then it must go through anaconda i think? i checked the python in anaconda and it is 32bits
https://gyazo.com/930044477b5180cd65da09922eb4ebbc
Posts: 5,042
Threads: 384
Joined: Sep 2016
Oct-17-2016, 10:27 PM
(This post was last modified: Oct-17-2016, 10:32 PM by metulburr.)
(Oct-17-2016, 10:10 PM)Zest Wrote: i ran it in the terminal and a similar error happens:
![[Image: d62c64801b849bbe9b5205f1e8dc2620.png]](https://gyazo.com/d62c64801b849bbe9b5205f1e8dc2620.png)
Usually .so is a lib built under linux with the equivalent in windows a .dll.
Is the person that gave you this "toolbox" running linux?
Posts: 7
Threads: 1
Joined: Oct 2016
Oct-17-2016, 10:31 PM
(This post was last modified: Oct-17-2016, 10:32 PM by Zest.)
@ metulburr,
ahhh that could be the problem. so i'd just have to convert/recompile it to a .dll file and adjust the modules a bit right?
now i just need to find out how to create the .dll files :)
thanks
Quote:Is the person that gave you this "toolbox" running linux?
i don't know, seems probable
|