I create a virtual environment named djangoenv. I can run it with using cmd but I cannot in python terminal
this is cmd picture and this is python terminal picture
how can I run this server in python terminal?
Asked
Active
Viewed 244 times
0
-
1Welcome to StackOverflow. Please post the relevant information in text rather than image. For more info check [why not post images of code or error while asking question.](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557) – Shivendra Pratap Kushwaha Aug 10 '21 at 07:00
-
why are you trying to run from python terminal... you have to run it from your OS terminal like cmd or terminal if you have mac or unix... – Shivendra Pratap Kushwaha Aug 10 '21 at 07:19
-
The second one is a PowerShell-Session I think. For some reason, it does NOT show the env name in front, it is the same for me. You are still in the virtual env, there is just no visual feedback for it. If you "exit" once, you leave it, if you "exit" twice, the window will close. – dustin-we Aug 10 '21 at 07:56
2 Answers
0
Your script is block cause of execution policy. running this commend on windows PS may work for you
Set-ExecutionPolicy RemoteSigned

ehsan bakefayat
- 118
- 11
0
Have you tried running your django server?
This seems to be common when using Windows PowerShell, indicated by the prefixed "PS" in your second screenshot. For me it looks the same. Note: I am using Pipenv vor virtualenv management, but I think it also uses virtualenv, so the error should be the same.
CMD:
PowerShell:
For some reason, it only shows the environment name in CMD, but not in PS. Still, I am in the same environment for both sessions.
Just try starting your server.

dustin-we
- 498
- 2
- 7