bethesirius / ChosunTruck

Euro Truck Simulator 2 autonomous driving solution
732 stars 104 forks source link

RuntimeError: Bad magic number in .pyc file #20

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi i am using Windows 10 64bit but when i run the .pyc file it comes up with this error all the time but i had to record it and slow it down to 0.05x speed so i could see it but that only just managed to show it so i screenshotted it. It is below. Thanks!

ghost commented 7 years ago

Ok this is what i have got so far. screenshot 157

zappybiby commented 7 years ago

Usually this is caused by wrong python version

Go into the pyc file and see what the magic number is

Then compare it to this list http://stackoverflow.com/a/514395/7430976 To see if you have the correct version.

ghost commented 7 years ago

Where can i find it?

ghost commented 7 years ago

Also what python is it you used?

ghost commented 7 years ago

Because i use python 3.6.0

zappybiby commented 7 years ago

Ok, so I used HexEdit to read the __init__.pyc file located in ...\ChosunTruck\ChosunTruck\linux\tensorbox\utils among other locations.

The first two byes were "03 F3" which when reversed to "F3 03" give the decimal value 62211

According to the table, this means that it was built with Python 2.5b3

@chi3236 do we need to add "Python 2.5b3" (Python 2.7) to the prerequisites?

ghost commented 7 years ago

Hmm it is PyScaffold that one so i don't know :/

ghost commented 7 years ago

If you want we can do teamviewer and you could help me? Another thing is, it is caused by me using windows not linux?

zappybiby commented 7 years ago

https://www.python.org/downloads/release/python-2712/

Python 2.7 is backwards compatible with 2.5. See if that works...

zappybiby commented 7 years ago

So the windows version doesn't use tensorbox, so there is no python code to execute. It is c++, you will need Visual Studio 2013

ghost commented 7 years ago

oh i have Visual Studio 2015

zappybiby commented 7 years ago

That works, but you will need to build the OpenCV CUDA libraries with CMake. The current versions of OpenCV use 'shared libraries', meaning they took a whole bunch of libraries and put them into one. For our code, we need each library separate, also called 'static libraries'.

Since that is pretty difficult, it is much easier to use Visual Studio 2013 and follow the troubleshooting instructions in our README to get those libraries. You can have both 2013 and 2015 on your system, it will let you choose which one you want to use when starting the program.

ghost commented 7 years ago

I cannot get Visual Studio 2013 because i have to be this subscriber

zappybiby commented 7 years ago

You need to login with your Microsoft account. Visual Studio 2013 is free to use once you login.

ghost commented 7 years ago

ahh ok

ghost commented 7 years ago

Still won't let me get it and will only let me get 2015 :/

zappybiby commented 7 years ago

Ok, lets do teamviewer I guess.

My email is blittle65@gmail.com. Send me the ID and PW

ghost commented 7 years ago

ok i sent it, sorry i was AFK.

zappybiby commented 7 years ago

How did it go? Are you still having this issue or can we close it?

ghost commented 7 years ago

i haven't tried yet as i got a reply on one of the vids from my comment saying Windows version does not work so :/

ghost commented 7 years ago

but i could try and the only problem is i don't know how and what to do as the Windows Instructions are a little bit small and there is no tutorial :( Sorry if i cause any bother.

zappybiby commented 7 years ago

Windows version works but we are still in the process of implementing input (see pull requests). As of right now input is not implemented and so the Windows version only detects lines for now. Input is essentially finished, just needs to be pushed + fine tuned.

I'll try to see if I can update the tutorial. What prerequisites do you already have? Did you install the Cuda Toolkit? Do you now have Visual Studio 2013? Did you get the Nuget packages?

You should open a new issue if the answer to any of those is no.

ghost commented 7 years ago

i have got Visual Studio 2013 but there is no build option now, well there was never one but i haven't got the CUDA Toolkit

zappybiby commented 7 years ago

Follow the instructions in our readme to install the CUDA Toolkit...

ghost commented 7 years ago

ok

ghost commented 7 years ago

I'm having problems, i have installed the CUDA Toolkit and Visual Studio but now when i try to get the NuGet Gallery Opencv CUDA Contrib vc12 Release Build 3.1.0. It is coming up with errors in VS2013

PM> Install-Package opencvcuda-release Install-Package : The current environment doesn't have a solution open. At line:1 char:1

PM>

zappybiby commented 7 years ago

... you need to create the solution

Save all (Crtl +shift + s) then it will ask you where you want to save the .sln file. Then open that .sln file and repeat nuget

ghost commented 7 years ago

umm ok

ghost commented 7 years ago

it isn't doing anything. i sent teamviewer stuff through email again.

ghost commented 7 years ago

Thanks to zappybiby, just about everything is working but for some reason i am getting errors while building the solution and i have screenshotted my screen twice to show list of errors. http://imgur.com/a/pLht9

zappybiby commented 7 years ago

Those are linker errors. Look at our Readme on how to fix that.

ghost commented 7 years ago

ok

ghost commented 7 years ago

Right it fixed most but now i have this error image

zappybiby commented 7 years ago

Nuget should have made a folder for you with all of the required libraries. This is usually in your main directory (\ChosunTruck)

You need to link to those, not to the opencv folder.

ghost commented 7 years ago

ahh ok

ghost commented 7 years ago

which one redist or the other?

ghost commented 7 years ago

i tried both and still the same error

ghost commented 7 years ago

image

ghost commented 7 years ago

Now it says this. image

AntonioCS commented 7 years ago

@keyring52 Please google the error msg

Second thing I found with a quick google search: http://stackoverflow.com/questions/15978035/cannot-open-input-file-opencv-calib3d243d-lib

ghost commented 7 years ago

ahh i'll try that EDIT: i checked and everthing is alright and all correct it just keeps saying that error so i'll reinstall the opencv thing

ghost commented 7 years ago

wait if i take the "opencv_calib3d310.lib;" out it goes to next one and says same thing cannot open.

zappybiby commented 7 years ago

Ok, so all of those files are required for the program to run. If you take one out, it moves on to the next one, but it will not run without that file. You need to search for that file on your computer. Use the search box in your chosuntruck directory to find the folder containing the files you need.

ghost commented 7 years ago

i have found them but nothing is wrong to me it all looks how it should

zappybiby commented 7 years ago

Again, opencv 3.0+ switched to shared libraries. We need static libraries that are obtained from nuget. You need to link to the nuget libraries. Reinstalling opencv will not fix this.

zappybiby commented 7 years ago

All I can tell you is that he error you are gettng is because Visual studio is not finding the file. Try altering the include directories again. Double check your linker directories too

ghost commented 7 years ago

ok i kinda changed the directories and it all shows up properly and works then i get this. image

ghost commented 7 years ago

Reinstalled it and i get this now image

zappybiby commented 7 years ago

You are getting the same error (lnk1104)

Look at solutions here: http://stackoverflow.com/questions/133698/why-does-fatal-error-lnk1104-cannot-open-file-c-program-obj-occur-when-i-c

Maybe run VS as admin.

ghost commented 7 years ago

It's gonna have to be teamviewer again as it isn't working again and it is different error now