Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: PyInquirer Not Detected in Virtual Environment #203

Open
AmirAlSakban opened this issue Apr 4, 2024 · 1 comment
Open

Comments

@AmirAlSakban
Copy link

I'm encountering a ModuleNotFoundError when trying to run my Python script that imports PyInquirer. Despite having PyInquirer installed in my virtual environment, the script fails to recognize the module.

The error mesage is:
Traceback (most recent call last):
File "[Censored]", line 3, in
import PyInquirer as Inquirer
ModuleNotFoundError: No module named 'PyInquirer'

note:
PyInquirer is correctly installed within the virtual environment.
Python version: 3.12
Operating System: windows
IDEs tested: vs code, pycharm
The appropriate Python interpreter from the virtual environment is selected

@hossam-elshabory
Copy link

I'm encountering a ModuleNotFoundError when trying to run my Python script that imports PyInquirer. Despite having PyInquirer installed in my virtual environment, the script fails to recognize the module.

The error mesage is: Traceback (most recent call last): File "[Censored]", line 3, in import PyInquirer as Inquirer ModuleNotFoundError: No module named 'PyInquirer'

note: PyInquirer is correctly installed within the virtual environment. Python version: 3.12 Operating System: windows IDEs tested: vs code, pycharm The appropriate Python interpreter from the virtual environment is selected

Make sure that the script is using the correct Python interpreter associated with your virtual environment.

You can try the following :

  1. Activate Your Virtual Environment:
    Ensure that the virtual environment where you installed PyInquirer is activated in the terminal where you're running the script. You can activate it by running:

    source path_to_your_env/Scripts/activate  # On Windows

    After activation, you should see the virtual environment name in your terminal prompt.

  2. Verify the Package Installation:
    With the virtual environment activated, check if PyInquirer is installed by running:

    pip list

    or

    pip show PyInquirer

    If PyInquirer shows up in the list, it’s installed correctly. If it doesn't, you might need to reinstall it using pip install PyInquirer.

  3. Check Your IDE Settings:

    Since you're using VS Code and PyCharm, make sure that both are configured to use the Python interpreter from your virtual environment.

    In VS Code, you can check this by looking at the Python version displayed in the bottom-left corner of the window.

    In PyCharm, you can verify this in the project settings under "Python Interpreter."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants