Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I installed pywhatkit, and it's stored along with other packages in my python3.8 file. However, I am not able to import it to VS code or any other IDEs. I tried installing tkinter. But I facing the same issue again. What should I do ?
Sometimes VS Code does this. You should install a library, after that just restart VS Code and the problem should be solved.
However, if the problem still occurs, it will be due to the Python version.
You are using Python 3, the issue is most likely that when you installed pywhatkit and tkinter you used the pip install library command, which will only install them for Python 2. To install the libraries for Python 3 just use the pip3 install library command in place of pip.
Make sure you have selected the right python interpreter. The Status Bar always shows the current interpreter:
Inspect whether you can find the packages you want to import in this environment.
Inspect where the packages you have installed through pip: pip show xxx.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I can't import libraries in python that I have installed using pip
as shown here.
Even other libraries such as PySimpleGui and PyGame don't work when I try to import them.
I have tried uninstalling and reinstalling the libraries and I am sure they are installed on my computer.
To sort this out, you need to establish two things:
where you (i.e. pip) installed the packages, and
where Python is looking for them
You can find where pip installed a package with:
pip show PACKAGE # e.g. pip show flask
Obviously, if you install using pip3 install flask, you will need to use:
pip3 show flask
Now you need to see which Python you are running and where it is looking for its packages:
import sys
print(sys.executable) # show which Python we are running
print(sys.path) # show where it is looking for packages
Hopefully you will see you are not installing into the Python interpreter you are using.
I think you might have installed them under a different folder or space than what you need. For example the code below installs the library at your current space, while simply pip3 install pygame might be somewhere else.
python3 -m pip3 install pygame
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 26 days ago.
Improve this question
I am using Windows.
I just installed PyCharm and Conda. I also installed some modules via the command prompt.
I am attempting to import the 'requests' module.
This is what the Python Console says when I type in 'import requests':
ModuleNotFoundError: No module named 'requests'
Why is PyCharm not locating this 'requests' module? How do I get the module into the correct location to be imported?
Since you specifically stated: "Python Console says when I type in 'import requests'" it makes me feel like it's not an IDE/PyCharm issue, rather just an install/env issue. The Python environment does not have the requests module installed. It needs to be installed before you can import it.
More info on requests from on PyPi
Installing it is different depending on your environment and project structure.
For example, a basic install would be: pip install requests or python -m pip install requests
Or, depending on your configuration, perhaps pip3 install requests or pip install --user requests or poetry add requests etc etc all depending on your project environment.
Overall, as a side note, Python dependencies can be a nightmare if you are doing everything system-wide and working with different projects. It's highly suggested for each Python project to have its own virtual environment. An easy way to manage dependency versions and handle virtual environments is by using poetry which can manage these things in a config file + handle version locking. It'll solve these types of issues and ensure your project/dependencies can work properly on different systems.
Assuming you used pip to install the module, you can check if it is installed at all by typing "pip list" in the command prompt and then look for the module name and version.
If it does show up, go to PyCharm and go to:
File->Default Settings->Project Interpreter
If it doesn't show up there, click the +-button and then you should be able to add the packages you want.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
I am using Pycharm IDE. I am doing a project that requires an older version of Tensorflow. I tried installing in from within pycharm marketplace using specified versions, but it says that there is no matching distributions found. So, I downloaded Tensorflow v1.8 sourcecode from Github as a zip. Now I want to install it in pycharm. How do I do that?
Having an IDE with things like a 'marketplace' is nice in theory, but you'll always end up having to resort to the commandline. Try to open the Terminal in PyCharm, it should activate with the python environment of your project. Then install tensorflow 1.8 with pip install tensorflow==1.8.0
For the latest version
pip install tensorflow
For the previous ones
pip install tensorflow==THE VERSION YOU WANT
pip install tensorflow==1.5
Or with pyCharm
Preferences> Project: PROJECT NAME> Python interpreter
Click on the + symbol at the top left and look for the package you want to install
(At the bottom right you can also check the Specify version box and choose the version you prefer)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
How to install python library such as 'dash' which are not installed by default in Visual Studio Code.
Install Python extension provided by Microsoft, then add a python virtual environment as described in VS Code documentation :
python -m venv .venv
Select the virtual env (bottom left corner of VS Code) and open a terminal with VS Code. Make sure the script activate from the virtual env is executed (your terminal should append (.venv) notation) and import your library with pip install :
pip install dash
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 months ago.
Improve this question
I installed Camelot module for python 3.7 on computer without internet connection, installed dependencies (tkinter & ghostscript).
When I try "import camelot" in jupyter notebook I get error "no module named cv2".
I can't find cv2 module link to download it separately.
How can I solve this problem?
This got rid of the error for me.
pip install camelot-py[cv]
I'm using a Mac with Apple Silicon and the camelot-py[cv] method didn't work. I installed opencv separately and everything has been working fine so far.
pip install opencv-python
install comelot-py
python -m pip install camelot-py