impossible to use pip - python

I start on Python, I try to use mathplotlib on my code but I have an error "ModuleNotFoundError: No module named 'matplotlib'" on my cmd. So I have tried to use pip on the cmd: pip install mathplotlib.
But I have an other error "No python at 'C:\...\Microsoft Visual Studio\...".
Actually I don't use Microsoft Studio anymore so I uninstall it but I think I have to change the path for the pip module but I don't know how... I add the link of the script of the Python folder on the variables environment but it doesn't change anything. How can I use pip ?

Your setup seems messed up. A couple of ideas:
long term solution: Uninstall everything related to Python, make sure your PATH environment variables are clean, and reinstall Python from scratch.
short term solution: Since py seems to work, you could go along with it: py, py -3 -m pip install <something>, and so on.
If you feel comfortable enough you could try to salvage what works by looking at the output of py -0p, this should tell you where are the Python installations that are potentially functional, and you could get rid of the rest.

Related

Why can't I use/import a ttk theme in Python

So I was trying to use a ttk theme named "Sun Vally" (Link) But when I tried to use it, it gave an error of "ModuleNotFoundError: No module named 'sv_ttk'" even though I already have pip installed it.. I am still new to all this.. thanks in advance!
For starters, try running the command pip list in your terminal. Does the module sv_ttk 1.0 appear in the list? If not, you may need to try running pip install sv-ttk again. This also assumes you aren't using a Python virtual environment, but I imagine you aren't.
You may also want to check if the module is properly installing into your site packages directory (the location of which is platform dependent). Are you on Mac OS or Windows?
Please update this question with a minimal example of what you've already tried so we can help you further.
IF FIGURED IT OUT! I was using cmd to install pip but never realized I needed to use a different terminal... Turns out PyCharm has its own terminal and wont work if you used a different one...

Can't find any python package after running cleaning cache

I have been using python in VS Code for a while, everything was smooth. But yesterday I accidentally pressed "Run CC Cleaner" on my PC. This, among other things must have cleared some VS Code cache and I no longer can run scripts.
In cmd for example it says that "pandas can not be found" while pip says that it definitely is installed.
Running !python - m pip install pandas in VS Code just does not do anything.
Something must have severed the connection between python and VS Code.
The Python and the Python Extension do not have some connections, the Python Extension just needs to find the path of the Python.
It looks like an environment problem. Could you check which pip you are using with the command of pip --version?
But I was confusing of python - m pip install pandas in VS Code just does not do anything, could you explain it clearly?

Can't import module after manually installing

I have installed the module pynauty via https://web.cs.dal.ca/~peter/software/pynauty/html/install.html. Everything seemed to work, and I believe that it is fully installed. However, when I try importing it in python shell, it says there is no module named pynauty. I think I am missing a final step in installing. Does anyone know what that final step would be?
I just grappled with this problem myself. As creimers pointed out, the setup script calls pip install --user . which installs pynauty in ~/.local/lib/pythonX.X/site-packages.
What you probably want is to have it installed in /usr/bin/python (or whatever pops up when you type which python). Assuming you already called make user-ins, all you need to do is run
sudo pip install .
from inside where you extracted and built your pynauty.

How to install a module on Python?

Okay, so, I'm actually a beginner in programming Python, and I only found out yesterday how you were supposed to encode pip install ModuleName in the Python command line and not in the interactive shell. I'm trying to download a lot of modules, such as the Send2Trash module, Pyperclip, Requests, Beautiful Soup, and Selenium.
Before I checked the forums about installing modules, I found out how we needed to have the pip tool. I'm a Windows user, but for some reason, I didn't have the 'Scripts' folder installed when I downloaded Python. I didn't know we needed it, so I used raw scripts from GitHub, setup.py, and copy pasted the script into the File Editor in Python, ran it in the interactive shell, and tried to import the module I needed. It worked for the Pyperclip and the Requests module; no errors popped up after I imported them using import pyperclip or import requests, but when I tried the same procedure for the rest of the modules I needed, there were some errors.
Also, when I tried to download the modules on pypi.python.org, I tried to open it using the interactive shell, but then something pops up, 'The file's encoding is invalid for Python3.x...', and when I click 'OK', it's going to say 'Failed to Decode', and close everything.
So, after reading forum after forum, I found out how to download pip, and was also able to download setuptools and wheel. I'm not sure if it's really already downloaded, but I was able to get the 'Scripts' folder that wasn't there before, so I guess so. I also already went into my PATH using the edit environment for your account thing, and I edited the Path variable so its value would lead to my 'Scripts' folder. Please do tell me if I did the right thing here.
So, following the advice of the forums, I tried to install the modules I needed by typing pip install ModuleName in the Python command line instead of the interactive shell, but it still gave me a Syntax Error. I also tried it in Command Prompt, typing the same code pip install ModuleName, but when I clicked Enter, nothing happens; no errors or anything. It seemed like my install was accepted, but when I tried importing the module in the interactive shell, it still gave an Import Error.
Please tell me what I did wrong throughout my process, and how to properly install the modules I need. I would include pictures into this, but it seems I can only add two before my reputation becomes 10, and I'm pretty new here, so... If there's anything I need to elaborate on about my problem, don't hesitate to ask, and I'll try my best.
You say you use windows so you need to understand pip.
pip is a program that installs python modules. You can even use easy_install instead of pip.
some pip commands
pip list -- lists out already installed modules.
pip search <module name> -- searches new modules.
pip -h -- more pip commands you want.
pip installs modules from CMD prompt not from python shell.
Even after installing modules some modules doesn't run as import module
they need to be imported as from module import function.
refer the pip help command and install modules.
DO NOT SAVE SCRIPT FILES IN PYTHON ROOT FOLDER YOU MAY FACE SOME PROBLEMS
Happy Programming!!!
After a whole lot of searching and trying out, I found the solution to my problem. For future Python users who encounter the same thing: always install your modules in the root folder.
In my case, my Command Prompt was automatically inside the C:\Users folder, which caused some problems because I couldn't download my module in there. Once I typed in cd C:\Python34, which was my root folder, I could successfully download the modules I needed using pip install ModuleName.

Installation Package, for using Pandas

I have pretty low experience with Python, but I'm tasked with creating an installation package so that I can distribute a GUI that messes with Time Series of Stocks taken from online. Based on what I've seen online, Python 3.4.1 has a built in module called ensurepip and pip, but for some reason I try and execute " python -m ensurepip" on the Python Shell, I get "Invalid Syntax"
I'm hoping to use pip to install all the dependencies for Pandas myself, but this is just one problem of many I suppose.
Edit: Slight update I suppose. I've checked my files and I know ensurepip is in the library of modules, and I've tried going through https://docs.python.org/3.4/installing/index.html and can't make heads or tails of it from my issues. Thanks in advance.
Edit2:http://puu.sh/azkqQ/4a5606a1f5.jpg
Picture indicating what I get. I've tried on the Command Prompt without the py and within the py
you're calling that command from the python shell. but it should be called from the command line. so just open up cmd or terminal and run that there, you should be fine.
and in the future, you should show the entire error. you probably got something like:
python -m ensurepip
^
SyntaxError: invalid syntax

Categories