1

I am running a Cryptocurrency-trading python program on my laptop It monitors the market every second and when the condition is satisfied, it tries transactions.

When I run it on windows CMD, it causes many problems below.

1. Sometimes, it halts till I click the cmd window and press 'enter' key

2. Sometimes, it causes many unknown errors.

However, when I run that on VScode, it does not cause any problem.

I wonder what makes the difference between those two environments.

3
  • "Sometimes, it causes many unknown errors." I'm not sure what you mean by this. Do the errors not appear? What makes them unknown? Commented Feb 8, 2022 at 12:42
  • Let me change that expression to 'unexpected errors'. I know the what types of errors are but I wonder why it only happens on CMD, not on VScode. They run a same python file. Commented Feb 8, 2022 at 12:50
  • 1
    It depends on the errors. If they are path related, it's most likely because VSCode is running from a different path than you are running from command. It also could be because you have a different interpreter or venv selected in VSCode then what your PATH points towards. But all this is just guessing without seeing the code or errors. Commented Feb 8, 2022 at 12:53

1 Answer 1

1

I have had some issues with VSCode not finding libraries and similar, and the reason for that is that VSCode runs its own python. In IDLE (and CMD) you run the raw python in AppData, but VSCode runs an executable they have downloaded via extensions through the program files folder. My hypothesis is that Python as in the AppData folder is corrupted or wrong in some way, but the Program Files folder is correct. It may even be on a different python version.

Try reinstalling python from the official python website, and run it again. Also double-check that the VSCode Python extension version is the same as the one saved in "C:\Users\YOURUSERNAME\AppData\Local\Programs\Python\Python39".

Hope it worked!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.