Why python didn't see nltk module? [duplicate] - python

This question already has answers here:
How do I use installed packages in PyCharm?
(14 answers)
Closed 4 months ago.
I cant run my programm because nltk module is missing but i just intstalled it and it just right here in the folder
I tried to reinstall my python, and tried to change python interpreter but nothing worked

How have you actually installed nltk?
You can check if it's actually installed with pip freeze.
What might be happening here is that you could have another version of python installed, so make sure that you actually call the same interpreter for checking and installing with pip, in your case E:/pythonProject1/Scripts/python.exe -m pip freeze and E:/pythonProject1/Scripts/python.exe -m pip install nltk

Related

Is it possible to move pip packages from one python version to another? [duplicate]

This question already has answers here:
How to install python packages from older version to newer version?
(2 answers)
Copy installed packages using pip to another environment
(1 answer)
Closed 2 years ago.
I have been using python 3.8 for quite some time , but now I want to use python 3.9. The problem is that I have a lot of packages installed in the 3.8 folder. Is it possible to "move" all these packages to the 3.9 folder? Or can anyone suggest me a better way to deal with this issue?
You can make a requirements .txt file by:
pip freeze > requirements.txt
and after installing python 3.9 type(in the same directory in which you made the requirements.txt):
pip install -r my_packages.txt
As shown in this post

Installed Python 3.8.5, but my terminal still detects Python 2.7 (Catalina on mac) [duplicate]

This question already has answers here:
Dealing with multiple Python versions and PIP?
(28 answers)
Closed 2 years ago.
I was trying to install biopython with pip, but I get an error saying Python 3.6 or later is required, but 2.7 was detected. Weirdly though, when I look for my python version, it indicates I have 3.8.5 installed.
Should I move directories somehow? I just upgraded my Catalina version and did a thorough cleanup on my mac. Maybe I accidentally moved a file or two?
here's what my terminal looks like
Thank you!!!!!
You have to deconflict pip and make sure you're using the right one. There's a good answer on another Stack Overflow question.
The bottom line is, you might try:
which -a pip
to see all pip installations in your path.
You can use a specific version of pip like this:
python3 -m pip install something
or, I think you can also do:
pip3.6 install something

How to use opencv module in python(I'm using pycharm) [duplicate]

This question already has answers here:
Cannot find module cv2 when using OpenCV
(24 answers)
Closed 2 years ago.
Thanks to read my question.
I got homework to print figures and try to use opencv module.
I search internet and download opencv by using cmd.(pip install opencv-python)
But in pycharm, I can't use opencv module.
Error massage tells me
ModuleNotFoundError: No module named 'cv2'
I don't know about programming well, It's hard to me guess reason.
Some theory is my code file is in D drive, not C drive which pycharm or python is install.
If you have python version 3 and above:
pip3 install opencv-python
If you have python version 2 and above:
pip install opencv-python
If you have used these commands and installed the package successfully, there is a good chance that your pycharm is not using the python version that you have installed this package on.
If you just want to be assured that you have installed the package correctly use
pip list
and check if the opencv-python is in the list. If you are seeing this package in the list you should check the version of your pycharm python interpreter.
Checkout this link for more information:
https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html

How do you specify which python distribution to install a module for with pip? [duplicate]

This question already has answers here:
How to use pip with Python 3.x alongside Python 2.x
(11 answers)
Closed 6 years ago.
I am trying to install the yweather module for python 3.5 on my mac using pip install, however as i have both python 3.5 and 2.7 i don't know how to specify which distribution to install the module for - how would you do this?
pip will install a module for the default python on your system. If you want to be sure that pip installs for a specific version, use pip2 or pip3 instead of pip.
Also if you aren't already, you should consider using virtual environments.
As seen in the docs
Download the most recent release from yweather’s PyPi page. Unpack the
tarball. From inside the yweather-0.X directory
Python 2
python setup.py install
Python 3
python3 setup.py install

different versions of python in one mac, how can I open a specific version among them? [duplicate]

This question already has answers here:
Dealing with multiple Python versions and PIP?
(28 answers)
Closed 6 years ago.
I just started learning python and while I tried to follow several examples, I installed different versions of python in my mac.
I found out there are already python in my mac later, and I did not consider it seriously.
Anyway, I tried to do something with idle, or python 3.5, and it does not have bumpy module.
I then tried to install the module so I opened a terminal and "pip install bumpy:"
it says it already has that in python2.7
Are there ways that I can do pip install thing in terminal into python3.5?
Thanks a lot.
Sincerely,
Jaeho
Try using pip for 3.5:
pip3.5 install bumpy

Categories

Resources