jonaro00/AutoTrader

I cant get it to work

Closed this issue · 10 comments

Ive tried everything but it always comes up with this
´Traceback (most recent call last):
File "C:\Users\User\Desktop\PokeTrade\trade.py", line 11, in
import yaml
ModuleNotFoundError: No module named 'yaml'´

Run pip install -r requirements.txt to install the three external packages needed.

I have done that buy still no luck. Second time running requirements.txt shows that i have allready installed them

I pushed a small update with locked version numbers. You can try that first.

Otherwise you could try creating a virtual environment.
What OS and Python version are you running?

Ich will try it after work in about 7 hours but im using Windows 11 wird python 3.10

Also i tried to push the files via adb but the template is in .yaml and i tries to push a .json . I changed the extension it tries to push to a .yaml and it worked. maybe it has something to do with that?

Yeah, make sure you are using the latest version of AutoTrader, then make a copy of the template yaml file and move the values from your json file into it. Then adb push the yaml file.

If you get to the stage of trying a virtual environment, do so with
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt

Still doesnt work even while im in the virtual environment after installing the requirements. What do you mean by move the values from the json? i just make two copies of the yaml file one named s9.yaml and one s21.yaml. then I use your guide to get the coordinates and put them in the corresponding yaml for the device and push them. In your original post you try to push a json file but if not changed its still a yaml file so it fails. How do i get a json file to push from the ConfigTemplate.yaml?

Ah, I have misunderstood you. Thanks for pointing out that my guide incorrectly says .json, I used json files before, but I switched to yaml and forgot to update the guide. I have now corrected the guide. Ignore everything about json.

You are doing the yaml file copying and pushing correctly.
Weird that it still doesn't work in a venv. 🤔
Does it still give you "module not found" error?

If it still does, you can check these:
When your venv is active and you run echo %PATH%, does the first path entry end in ...\venv\Scripts?
You can also check if the \venv\Lib\site-packages folder contains folders such as yaml.

Okay i think restarting my pc fixed it. At least with the venv it works now. made no changes just started to work and the only difference is that i restarted my pc. could you also make a script where it automaticly does everything that needs to be executed automatic? so i dont allways have to search this thread up to get it running? Thanks in advance!

The computer restart makes it seem like maybe the issue wasn't the venv.
It could have been an outdated PATH variable in your shell.
I suggest you try it without the venv again and see if that works now.

If it still does not work without venv, the only extra command you need to run before starting the script is venv\Scripts\activate (because the venv already exists and packages are already installed).

But ey, a script is fun. You can create a file run.bat and paste this

@ECHO OFF
call venv\Scripts\activate
python trade.py

and then you can type run to run the script in the venv.