#๐ not sure why I can't execute python script file from powershell?
22 messages ยท Page 1 of 1 (latest)
@versed pond
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
The script works just fine if I run if using pycharm IDE. But when I try to run it from powershell, it wont run as the nmap is not installed globally but as part of the virtual env. What can I change to run it through powershell?
You will need to activate the virtual environment. How did you create the environment?
If you created it with venv you run {virtual_env_folder_name}\Scripts\activate from inside the folder that has your virtual environment folder. Replace {virtual_env_folder_name} with the name of your virtual environment folder.
I created it via pycharm IDE
so I have gone and executed activate.bat
That should do it then. You should see the name of the virtual environment I'm parentheses on the left side of your prompt now.
In*
Yes. That is unfortunately outside of my wheelhouse but it looks like a link is provided there for you. Once you have the environment activated it should work. You can deactivate an environment by typing deactivate once you are done with it.
yea got it fixed
looks like i had to run set-executionpolicy remotesigned
as admin mode
this allows me to run scripts
Awesome. Glad you were able to get it fixed.
Great!
thanks @surreal breach
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.
๐ not sure why I can't execute python script file from powershell?