Jump to content

Python is stupid

Wictorian

Pip is not working..

Google is not helpful. 

 

As suggested I run it as administrator and I typed %PATH% and this itself gives an error. What the hell is wrong?

 

 

img.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Wictorian said:

As suggested I run it as administrator and I typed %PATH%

As suggested by whom? What was this supposed to accomplish?

2 minutes ago, Wictorian said:

Pip is not working..

How is it not working? Post the error message.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, Wictorian said:

Pip is not working..

Google is not helpful. 

 

As suggested I run it as administrator and I typed %PATH% and this itself gives an error. What the hell is wrong?

 

 

img.PNG

You likely messed up your path settings. Do you mind posting what it looks like?

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

Type 

 

ECHO %PATH%

 

in command prompt, and you'll get a list of paths that you can configure in your environment variables.

 

You're probably supposed to add the path to your pip stuff to your PATH environment variable so that when you type PIP directly in command prompt, the command prompt will know to look among those paths to find pip.exe in that folder.

 

by default, if you type pip  or some other name, the command prompt will look for pip.exe or some other name.exe in the current folder (C:\Windows\System32 in your picture) and if no such file exists there, it falls back to looking for the file among those paths in the PATH variable.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, duncannah said:

I recommend using WSL, setting up development stuff on Windows is a nightmare

No, it's not.

OP just miss understood a step, that is all.

 

His Environmental path was not set correctly is most likely the issue.

All he needs to do is open the Environmental Variable panel, and make sure the path to python is set correctly.

This is not a required step, just convenience.

Link to comment
Share on other sites

Link to post
Share on other sites

37 minutes ago, GoodBytes said:

No, it's not.

OP just miss understood a step, that is all.

 

His Environmental path was not set correctly is most likely the issue.

All he needs to do is open the Environmental Variable panel, and make sure the path to python is set correctly.

This is not a required step, just convenience.

Well, having to do this is already a pain, whereas in other OSes it's done automatically.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

14 minutes ago, igormp said:

Well, having to do this is already a pain, whereas in other OSes it's done automatically.

It can be automatically. It's just a registry entry which can be added via... (From a developer of a solution that needs/want to add environment variables) well... the registry APIs, or command line or PowerShell, or VBA script, or WMIC. They are all good.

 

In fact, Python offers you the option when you run the setup:
 

668079001_Screenshot2022-07-07214401.thumb.png.723194e9f7215dd0014f2ac4ec592760.png

 

Just check the box, hit "Install Now" and enjoy Python.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, GoodBytes said:

It can be automatically. It's just a registry entry which can be added via... (From a developer of a solution that needs/want to add environment variables) well... the registry APIs, or command line or PowerShell, or VBA script, or WMIC. They are all good.

 

In fact, Python offers you the option when you run the setup:
 

668079001_Screenshot2022-07-07214401.thumb.png.723194e9f7215dd0014f2ac4ec592760.png

 

Just check the box, hit "Install Now" and enjoy Python.

That's for python, not pip tho.

FX6300 @ 4.2GHz | Gigabyte GA-78LMT-USB3 R2 | Hyper 212x | 3x 8GB + 1x 4GB @ 1600MHz | Gigabyte 2060 Super | Corsair CX650M | LG 43UK6520PSA
ASUS X550LN | i5 4210u | 12GB
Lenovo N23 Yoga

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, igormp said:

That's for python, not pip tho.

Yes, it does it for pip as well.

 

744178078_Screenshot2022-07-07234855.thumb.png.150309a385329c0ff39e2173a2adeb79.png

 

I am a big supporter of WSL. It is a powerful dev tool.

But for OP case, in getting started with Python under Windows, it is not needed.

 

Windows development issue typically is due to some solutions being made for Linux only, or is poorly maintained for Windows, as its main base is on a Linux server environment (example: Apache). This is an example of where you want to use WSL. But Python is cross platform and well supported on all OSs.

 

Link to comment
Share on other sites

Link to post
Share on other sites

on powershell or cmd you use pip as such

py -m pip YOUR_PACKAGE_NAME

but you are not supposed to use that command directly in your system.

 

firstly you need to create a new folder and move inside

mkdir my_awesome_web_application
cd ./my_awesome_web_application

 

then create your virtual environnement

py -m venv VENV

 

to start VENV in powershell:

./VENV/Scripts/activate.ps1

to start VENV in cmd:

./VENV/Script/activate.bat

once you start the script a little (VENV) will appear near you commandline header

 

you can now use your pip command without using "py -m". ex:

pip install flask

will install the flask librairy and his dependencies.

Link to comment
Share on other sites

Link to post
Share on other sites

On 7/7/2022 at 11:48 PM, GoodBytes said:

well supported on all OSs.

to be exact "on all mainstream/PC OS"

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×