Problem making Python install praw - syntax error? - python

Every guide I've found on the web says that all I have to do to install PRAW is type in:
>> pip install praw
However, I've been trying to do that for an hour and it just keeps saying 'invalid syntax'. I tried on windows command prompt, and that doesn't work. I installed PIP when I installed python, but I'm not seeing a python install on my C:\ drive and no matter how many times I reinstall I can't make this work. It's driving me nuts. Does anyone know what I'm doing wrong?
I'm on Windows 10 with the latest version of Python

It turns out I didn't install for PATH. This was easy to miss as it's tiny and on the first installer page. It also didn't totally solve the problem, but did allow me to install PRAW.

Related

I did a pip install --user with anaconda prompt and now anaconda navigator will not work regardless of uninstalling and reinstalling

So i was trying to get spyder-notebook for spyder 5.2.2 and was having all sorts of issues getting the proper packages (end conclusion its impossible until spyder pushes and update). I went against the guidance I found on anaconda's site about using pip install --user (https://www.anaconda.com/blog/using-pip-in-a-conda-environment), however I figured worst case if a mess something up I can just uninstall and reinstall the program... But that turned out to be not true.
I've uninstalled and reinstalled anaconda navigator now 4 times, trying something new each time, but I keep getting the error shown below:
I've tried looking for guidance to resolve this issue, but cannot find anything helpful so far so any direction is appreciated.

How can I uninstall a corrupted PIP instance on Windows?

Today, I was trying to install Python 3.10.1.
I was successful in this, but, then, as I was installing Flask, pip will tell me that it installed, then, when I run the script, it says nothing is installed.
After a while, I realized I was running my Python scripts in Python 3.10.1, but I was running pip in Python 3.7. I did as this post said and ran pip --version to discover this.
I ran pip show flask to see where the module is, and it's in the Python 3.7 folder.
However, when I tried to uninstall Python 3.7, I can't find it in my start menu or in Control Panel > Programs > Programs & Features. I believe I had uninstalled it a long time ago.
To counteract this, I did as some YouTube video said (I lost the link to it) and re-installed Python 3.10.1, checked the "Add to PATH" option, checked to install for all users, and checked on the pip install.
After doing this, I upgraded my pip version to the latest version, uninstalled Flask, and re-installed it.
It was still installed in the Python 3.7 folder.
Next, I decided I will just uninstall PIP.
I ran CMD as an Administrator and typed pip uninstall pip as instructed here.
However, when I did this, it says I'm missing access to the places it wants to modify.
I found that strange, so I checked if I'm actually running it Administrator, and, yes, I am.
I looked at the directories that it wants to modify and gave ADMINISTRATORS ownership of all of them.
Absolutely nothing changed and did it again.
I gave myself ownership of it and did it again.
Absolutely nothing changed.
Then, I decided to run pip uninstall pip again. It says pip is not installed. That's strange.
I typed pip, and the help command for pip shows up.
Then, I (probably stupidly) went to all the directories and files PIP listed that it wants to uninstall, and manually deleted them, then uninstalled Python 3.10.1, and made sure to install PIP from there.
And now we're back at Python 3.7, and pip still isn't installed somehow.
I don't know what's happening. I haven't coded anything in Python for 2 or 3 years, and I want to try again, but this is starting to confuse me. Could anyone help?
Edit: Based on the suggestion of one of the answerers, I tried to manually delete pip. I couldn't find it in %APPDATA%, but pip --version shows me the path.
I tried deleting pip from there, but it says I need permission from ADMINISTRATORS. I am an administrator on my computer -.-
Anyways, I tried to take ownership of the folder, but nothing ever came of that.
Try to locate %APPDATA%\pip\pip by typing it into the file explorer. Pip will be located there, and you should be able to delete it.
I've managed to fix the issue.
I found that if I press this button in the start menu search for Python 3.7, it's possible to uninstall it from there (Control Panel said it uninstalled it when I used that, but it didn't).
I think I had installed Python from the Microsoft Store, which is why I couldn't find it in %APPDATA%.
Once I did that, I tried to uninstall Python 3.10 then re-install it. It kept saying it's installed, but it wouldn't show up in Command Prompt.
I fixed this by installing Python 3.10 from the Microsoft Store instead.
This fixed the problem.

Error "No module named pywin32" after downloading it in anaconda

I'm trying to create a module that uploads multiple files to an email using python. The method I've elected to use is found here (https://www.codeforests.com/2020/06/05/how-to-send-email-from-outlook/) which requires that you install pywin32. I tried to do the pip install, which didn't work as it was already downloaded, but I'm still having trouble getting the module to run properly. I've tried uninstalling and reinstalling, and I have it in Anaconda on both my base & spyder environments, but every time I run it (either JNB or Spdr) I get the same ModuleNotFoundError.
Thanks in advance.
So it turns out everything worked out whenever I downgraded the version of python I was using...
pip install pywin32==225
Thanks for your help, everyone!

Visual Studio Code Python 3 Command/Install Error

When I've been opening VS Code lately I've been getting this message saying
The "python3" command requires the command line developer tools. Would you like to install the tools now?
Everytime I click yes and the installer prompts me that it can't be found on the server. Not sure what's going on here. I tried looking at other posts but didn't really see a similar issue. Maybe I missed something.
I'm running the latest version of Python 3 when I check it in the terminal.
On MacOS Catalina 10.15.7 (19H2).
According to your description and feedback, the cause of this problem is that the installation tool pip cannot be used. You can use the following methods to solve it:
You can reinstall pip manually. Install pip.
Usually, python comes with pip, you can also download python again. Install Python.
You can also use the conda command to install what you need when Anaconda is installed. Use conda.

"No module named" after pip install tweepy

I've been trying to fix this problem for a WHILE now. I've been looking online and trying anything I could find – from uninstalling and reinstalling pip, to uninstalling and reinstalling python – and I still can't find any solution. This only began after I updated my MacBook Pro to macOS Catalina (currently on 10.15.5) so I'm thinking this might be a permissions issue. Basically, I'll pip3 install a python module (or pip install – I've tried both, neither work) and I still get the "no module named ____" error afterwards. Currently on VSCode, but I've tried Idle, or even just running the file in terminal and nothing works.
Let me know what I could do, or if there's any more info I should provide!
Edit: Here is what I get for "which python" and "which python3", I dunno if that's related to the problem in any way but here you go:
$ which python
> /Users/asaflebovic/opt/anaconda3/bin/python
$ which python3
> /Users/asaflebovic/opt/anaconda3/bin/python3
If you want to install a package inside anaconda environment, I think you should have used conda instead of pip. As for checking whether tweepy is really installed or not, activate anaconda environment and then run conda list. If tweepy is listed there then you should be able to import tweepy.
And be sure to remember when you run the code you should always activate the environment where the package required by that code is located.
ps: actually you didn't need to install anaconda.

Categories