2

After checking other related threads I had to open this one. When trying to run this repository I am always getting the error:

Traceback (most recent call last):   File "C:\Users\jjj\evrpogmrl\main.py", line 1, in <module>
    from Environment import environment   File "C:\Users\jjj\evrpogmrl\Environment.py", line 5, in <module>
    from battery import lithium_ion_battery   File "C:\Users\jjj\evrpogmrl\battery.py", line 1, in <module>
    import numpy as np   File "C:\Users\jjj\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import core   File "C:\Users\jjj\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy\core\__init__.py", line 23, in <module>
    WinDLL(os.path.abspath(filename))   File "C:\Users\jjj\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode) OSError: [WinError 193] %1 ist keine zulässige Win32-Anwendung

I have python 3.6.2 64bit installed and installed every library via pip. Is there anything I am doing wrong? Should not be every library 64 bit? As there is tensorflow required, the pythoncode itself should be 64 bit aswell. If not, how can I check this in the future and what can I do about it now (as I would have to install tensorflow even though I am using 32bit python which is not supported by tensorflow. Futhermore pip install did not work on 32bit python).

Hope you guys can clarify my problems as I am really new to python and programming.

julezQ
  • 45
  • 1
  • 5
  • 1
    Don't worry about `Win32` in the message. It does *not* mean you need a 32-bit version of anything. It does rather look as though you have `%1` in the variable `filename`. May be something in the `Environment` module but without code it is hard to say. – BoarGules Mar 06 '19 at 11:40
  • Thanks for your response! The code (main.py) is in the linked repository. So if you got time I'd really appreciate it. – julezQ Mar 06 '19 at 15:05
  • The problem is almost certainly not in the repository but in your files `Environment.py` or `battery.py` – BoarGules Mar 06 '19 at 16:48
  • I created https://stackoverflow.com/questions/55732949/python-produces-oserror-winerror-193-1-is-not-a-valid-win32-application-bu?noredirect=1#comment98144483_55732949 for a related but possibly different issue... – Brian Postow Apr 17 '19 at 18:24
  • Duplicate of [\[SO\]: Python Ctypes - loading dll throws OSError: \[WinError 193\] %1 is not a valid Win32 application](https://stackoverflow.com/q/57187566/4788546)? – CristiFati Jan 07 '23 at 17:27

0 Answers0