#๐Ÿ”’ not sure why I can't execute python script file from powershell?

22 messages ยท Page 1 of 1 (latest)

gaunt cipherBOT
#

@versed pond

Python help channel opened

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.

versed pond
#

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?

surreal breach
#

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.

versed pond
#

so I have gone and executed activate.bat

surreal breach
#

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*

versed pond
#

gotta change execution policies then?

surreal breach
#

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.

versed pond
#

yea got it fixed

#

looks like i had to run set-executionpolicy remotesigned

#

as admin mode

#

this allows me to run scripts

surreal breach
#

Awesome. Glad you were able to get it fixed.

versed pond
surreal breach
#

Great!

versed pond
#

thanks @surreal breach

gaunt cipherBOT
#
Python help channel closed

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?