My sublime REPL is currently running python 2.6.1, I have no idea how seeing as I have never downloaded it. I am trying to install matplotlib and keep getting this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib
So I thought installing python 2.7.5 would make this work instead, how do I do this?
When you hit Ctrl` to go to the console, you are using the internal version of Python that comes included with Sublime Text 2. You cannot run external modules with this version, it is static.
If you want to use your system Python, install Package Control, then install SublimeREPL. By default, this will use the version of Python that comes first on your system's PATH. Once running, as long as you've properly installed matplotlib, you should be able to import and use it within SublimeREPL with no problems.
Related
I'm trying to use Cygwin64 to run a python script, but it's not working because for some reason it can't find the module.
Traceback (most recent call last):
File "makeplot.py", line 1, in <module>
import vplanet
ModuleNotFoundError: No module named 'vplanet'
Where are modules installed in Cygwin64 and How do I make sure my module is installed?
It seems you are expecting that Cygwin version of Python should contain any type of module around.
If you look for vplanet, you will find the specific instruction for installation
https://virtualplanetarylaboratory.github.io/vplanet/install.html
python -m pip install vplanet
Have you tried it ?
Title. It just doesn't recognize it. For example, I'm trying to make a discord bot with discord.py. I do the pip install thingy, and it just spits this out when I try to run my file:
Traceback (most recent call last):
File "C:\Users\Pixel\Desktop\Discord bot\bot.py". line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'
It does exist, I checked: (C:\Python38\lib\site-packages\discord)
Am I doing something wrong here or am I just stupid? Thanks!
There are many possible reasons for this error. You might have multiple versions of Python running on your machine, so you could have installed the module in a version of Python that your code is not using.
Make sure you're using the write version of Python as your interpreter.
You could also try installing the module directly in whatever venv you're using by typing this command into the terminal in the same folder python3.9 -m pip install discord. Replace python3.9 with whatever version of Python you're using.
I am trying to run my code using Win+R.
I am able to run a python script without using third-party modules. But when I use some third-party module in my code it shows this error:
Traceback (most recent call last):
File "C:\Users\pkgar\Desktop\Newfolder\pw.py", line 6, in <module>
import sys,pyperclip
ModuleNotFoundError: No module named 'pyperclip'
Edit: I am able to run the code in VS code, but I am just curious how to run the code using Win+R command.It is running perfectly using Win+R command when I don't use pyperclip module at all.
you haven't installed pyperclip yet.
you can install it using pip install pyperclip on your cmd.
check this out
https://pypi.org/project/pyperclip/
and olso if pip itself hasn't installed yet use
https://pip.pypa.io/en/stable/installing/
I am coding on Python 2.7. I want a large list of words to have access to. Looking around, I have found that nltk has what I'm looking for. However, every time I try and install it I get a syntax error. I have tried doing the commands in the shell and in files. I have no true understanding of how pip, install, and download commands work. I am on a mac, which other threads have said could affect things. I have tried...
sudo pip2 install nltk
Which gives:
SyntaxError: invalid syntax
When importing, I get
import nltk
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
import nltk
ModuleNotFoundError: No module named 'nltk'
nltk.download
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
nltk.download
NameError: name 'nltk' is not defined
and a few other suggestions from other threads, but nothing works. Please help.
pip is your python package manager. It is a command line tool, and not a python function, object or method. This means you can't call pip from within python (at least not by just typing pip ... into a python interpreter). pip should come along with your installation of python 2.7, so you don't need to install it, as long as you have python installed.
You need to call pip from your command line (on a mac, this would most likely be from terminal). So you need to open your terminal, type pip install nltk, which should install your package.
Then, you can start python by using the command python in terminal. You can then import nltk using import nltk.
Only once you've followed those steps, and successfully installed and imported the nltk package, can you use nltk.download() to download nltk data. nltk.download() in itself has nothing to do with installing the package.
I would recommend following a python tutorial, such as the one linked, in order to gain an understanding of how to use the python interpreter. This should explain how to install packages, and use basic python functionality.
Most versions of Mac OS come with Python version 2.7, but not with pip.
First verify that you have pip installed from the command line:
pip -V
If pip is not installed, follow the instructions here:
How do I install pip on macOS or OS X?
Then, directly in the terminal type (not in the python interpreter)
pip install nltk
Then, open your python interpreter from the command line:
python
and in the python interpreter, try importing nltk
import nltk
I am using macOS 10.13.1 (which is the latest version at this moment) on a MacBook Pro 13" Early 2015, and am trying to install the "quora" library for python 3.6.1. I am trying to install it by typing this into the terminal:
pip install quora
When I do so, it says it is already installed. Then when I type into the python IDLE IDE:
import quora
As a single line program, it says that no module named quora is found, yet when my terminal specifically says it has already been installed.
Any information about how I can fix this will greatly be appreciated. Thank-you.
Edit #1:
When I input in terminal:
pip3 install quora
And I run the import in IDLE, it gives this error message:
Traceback (most recent call last):
File "/Users/Hussein/Downloads/quora_install.py", line 1, in
import quora
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/quora/init.py", line 8, in
from user import User, Activity
ModuleNotFoundError: No module named 'user'
Edit #2:
Up until this point I have been using the IDE for Python 3.6. I tried to run the import in Python 2.7, which is the default for the Mac, and works fine. But I do not know if there are functions that I need that may have been added to Python after the 2.7 release. I still wish to continue trying to get it work for v3.6.1.
Do you have multiple Python versions on your machine? Try pip3 install quora?