Django installation in windows command line - python

I've done below command in command line in windows:
python.exe setup.py install
It was running then came up with this error:
error: invalid command 'install_lib' (no class 'install_lib' in module 'distutil
s.command.install_lib')
Can anyone pinpoint what it is?

Download and install setuptools for windows and then run the command.

Seems like you don't have setuptools installed. You can easily install it with the ez_setup.py. After you did that, I recommend you to install pip with easy_install pip (easy_install comes with setuptools), then installing django is just: pip install django.

Related

Pygame install issue: Unable to establish a new connection error [duplicate]

I am trying to use command pip install pygame in cmd, but there is error.
The error is shown as follows:
C:\Users\Administrator>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/80/2c/3a52e7e9c097229b026b4efbe6711c600f3a84ffdc5f11fd9e7f8932368e/pygame-1.9.6-cp37-cp37m-win32.whl
Installing collected packages: pygame
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'c:\\program files (x86)\\python37-32\\Lib\\site-packages\\pygame'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I follow the instruction in the error but still cannot solve the problem. And I also found whatever "pip" command cannot be installed correctly.
You can install the package as Administrator, by following these steps:
1.Right click on the Command Prompt icon
2.Select the option: Run This Program As An Administrator
3.Run the command: pip install pygames
Instead of you can use the command
pip install --user pygames
The other answers didn't work for me. I checked this site and made sure that pip, setuptools, and ez_setup were installed at the latest versions. Still no luck. Finally, I discovered the magic words here:
pip install pygame --pre
Per this, --pre option tells pip to include pre-release versions of packages when searching for the latest version. Apparently that's what's needed as of this writing (2023-02-08).
(Thanks to accddd)
check if Pip was installed correctly by opening a command prompt and entering the following command:
pip -V
output should be like:
pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
if pip is not install copy this file link and save it to setup.py
now open cmd and run script by typing
python setup.py
for more details check link.
when pip in install correctly install run this commond
python -m pip install -u pygame --user
For this, you have to install pygame package from the cmd (on Windows) or from the terminal (on mac). Just type pip install pygame.If it doesn't work for you, then try using this statement pip3 install pygame. If it is still showing an error then you don't have pip installed on your device and try installing pip first.

Pip error when trying to run pip command from virtualenv on macOS

I have my virtualenv created in ~/Desktop/env. During install it states that pip was installed successfully, along with setuptools and wheel. After activation I attempted to install a module in my virtualenv using pip but was given this error:
File "/Users/myname/Desktop/hello/env_test/bin/pip3.7", line 5, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
Looking in the bin folder there are three pips - pip, pip3, and pip3.7. Running any of these commands gives me the error above.
Can anyone help me out here? pip3 works just fine outside of the virtual environment.
Thanks.
I had the same issue and re-installing pip (not upgrading) solved the problem on Mac OS: https://pip.pypa.io/en/stable/installing/
There is an issue with newer version of pip after 20.0.0 release https://github.com/pypa/pip/issues/7620
Suggested fix
pip install -U pip
NOTE: For anyone having this is issue in their CI try cleaning caches
I had exactly the same issue. A simple work around worked for me.
For python3, in the virtualenv, when running pip commands, instead of directly using pip, use python3 -m pip.
For example, use:
python3 -m pip install xx
instead of
pip install xx
Can you please post the commands you are issuing to install the environment?
I can suggest you to install pipenv and then try with:
pipenv install
pipenv shell

How to solve the "pip install pygame" issue?

I am trying to use command pip install pygame in cmd, but there is error.
The error is shown as follows:
C:\Users\Administrator>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/80/2c/3a52e7e9c097229b026b4efbe6711c600f3a84ffdc5f11fd9e7f8932368e/pygame-1.9.6-cp37-cp37m-win32.whl
Installing collected packages: pygame
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'c:\\program files (x86)\\python37-32\\Lib\\site-packages\\pygame'
Consider using the `--user` option or check the permissions.
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
I follow the instruction in the error but still cannot solve the problem. And I also found whatever "pip" command cannot be installed correctly.
You can install the package as Administrator, by following these steps:
1.Right click on the Command Prompt icon
2.Select the option: Run This Program As An Administrator
3.Run the command: pip install pygames
Instead of you can use the command
pip install --user pygames
The other answers didn't work for me. I checked this site and made sure that pip, setuptools, and ez_setup were installed at the latest versions. Still no luck. Finally, I discovered the magic words here:
pip install pygame --pre
Per this, --pre option tells pip to include pre-release versions of packages when searching for the latest version. Apparently that's what's needed as of this writing (2023-02-08).
(Thanks to accddd)
check if Pip was installed correctly by opening a command prompt and entering the following command:
pip -V
output should be like:
pip 18.0 from c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\pip (python 3.7)
if pip is not install copy this file link and save it to setup.py
now open cmd and run script by typing
python setup.py
for more details check link.
when pip in install correctly install run this commond
python -m pip install -u pygame --user
For this, you have to install pygame package from the cmd (on Windows) or from the terminal (on mac). Just type pip install pygame.If it doesn't work for you, then try using this statement pip3 install pygame. If it is still showing an error then you don't have pip installed on your device and try installing pip first.

How to fix install error in cx_freeze with pip?

I was trying to install cx_Freeze and every time an error happens. I tried to install it with pip, that didn't work, and I'm trying to install this by wheel, downloading the cx_freeze file from https://pypi.org/project/cx_Freeze/4.3.4/#files and using pip to install it by:
pip install cx_Freeze-5.1.1-cp36-cp36m-win_amd64.whl
I already have wheel installed in my computer.
How can I fix this?
if you want to install cx-freeze module you do not need to mention whole file directory...
you can just type:-
pip install cx-freeze
copy this command and paste it in cmd(command prompt)
if you want to install any package you have to write:-
pip install (package name)
hope the answer will be useful

Pip install of shapely giving "python setup.py egg_info" failed with error code 1 error

I am trying to install shapely 1.5.6 in Windows 10 (python 3). I am getting this strange error.
python setup.py egg_info" failed with error code 1 in c:\users\user1\appdata\local\temp\pip-build-g1iztcx1\shapely
I have tried updating pip but no luck.
What could be the problem?
You can directly download the Shapely Wheel here and run pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl (depending on the name of the package you decided to download).
This worked well for me with Windows 10 and python 3.
In case you are still getting errors with the above solutions just make sure that the shapely wheel you are downloading (here) is the correct one and matching your system's requirements. Make sure you choose the correct 32 bit or 64 bit that also matches the python version (cp37 is for python 3.7). After downloading the file and moving it to your Python directory, run the administrative cmd on Python directory and run:
py -3.7 -m pip install Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl
(Shapely-1.6.4.post1-cp37-cp37m-win_amd64.whl is the name of the wheel you decide to download)
Error code 1 means the "Operation is not permitted". Usually when that happens in Linux, you can just use sudo to resolve it. But on windows, you probably have to right-click on cmd and run as administrator to resolve it.
If unable to resolve it then try using easy_install to install the module. Then if still cannot, try updating the setuptools and pip. pip install --upgrade setuptools, pip install --upgrade pip.

Categories