I can't install "pip install python_bcrypt" - python

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> python_bcrypt
I can't install the python_bcrypt in visual studio code anyone know how?

This is could be an issue of wheel package. Some projects don't have wheel package in their source. I tried doing the same on my machine. It's running Python v 3.10.7 and pip v 22.3.1. I faced some warnings but no errors during the installation.
pip install python_bcrypt
Collecting python_bcrypt
Downloading python-bcrypt-0.3.2.tar.gz (19 kB)
Preparing metadata (setup.py) ... done
Installing collected packages: python_bcrypt
DEPRECATION: python_bcrypt is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for python_bcrypt ... done
Successfully installed python_bcrypt-0.3.2
I would say try upgrading your pip, setuptools, wheels
python.exe -m pip install --upgrade pip
pip3 install wheel setuptools pip --upgrade

Related

how do I install Kivy and kivymd in python 3.11.0

pip install "kivy[base]" kivy_examples:
Collecting kivy[base]
Using cached Kivy-2.1.0.tar.gz (23.8 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Collecting setuptools
Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting cython!=0.27,!=0.27.2,<=0.29.28,>=0.24
Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
Collecting kivy_deps.gstreamer_dev~=0.3.3
Using cached kivy_deps.gstreamer_dev-0.3.3-cp311-cp311-win_amd64.whl (3.9 MB)
ERROR: Could not find a version that satisfies the requirement kivy_deps.sdl2_dev~=0.4.5 (from versions: 0.5.1)
ERROR: No matching distribution found for kivy_deps.sdl2_dev~=0.4.5
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
how to fix? if you could help me. I am receiving this error is it my python verson? or the kivy version what could it be.
I tried using these verions:
python -m pip install kivy --pre --no-deps --index-url https://kivy.org/downloads/simple/
python -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/
but they dont work properly, has a lot of bugs and malfunctions
There is no wheel for Kivy and Python 3.11 yet.
You have to build Kivy from source. You can do that using the following commands. I am doing it in a virtual environment to keep it separate from the main system.
python3.11 -m virtualenv Kivy_Py3.11
cd Kivy_Py3.11
source bin/activate
git clone https://github.com/kivy/kivy.git
cd Kivy_py3.11
python -m pip install -e ".[base]"
python -m pip install kivymd
pip freeze
Kivy will now be installed and the 'pip freeze' should show: (version number will probably be different)
certifi==2022.12.7
charset-normalizer==2.1.1
docutils==0.19
idna==3.4
-e git+https://github.com/kivy/kivy.git#a7c66880270a93821e1f8ecd613409f008fd2ce8#egg=Kivy
Kivy-Garden==0.1.5
KivyMD==1.1.1
Pillow==9.3.0
Pygments==2.13.0
requests==2.28.1
urllib3==1.26.13
If you want to use the nightly build of Kivy that is more compatiable with Python 3.11 then you can just run these command.
python3.11 -m pip install kivy --pre --no-deps --index-url https://kivy.org/downloads/simple/
python3.11 -m pip install "kivy[base]" --pre --extra-index-url https://kivy.org/downloads/simple/
python3.11 -m pip install https://github.com/kivymd/KivyMD/archive/master.zip
I had the same issue and it was rectified by downgrading to 3.10 and it works.

error: subprocess-exited-with-error while installing lxml libary (windows x64)

I'm trying to install lxml but this error occurs:
pip install lxml
Collecting lxml
Using cached lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: lxml
DEPRECATION: lxml is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
Running setup.py install for lxml ... error
error: subprocess-exited-with-error
#the output is cut off
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I tried this sudo apt-get install libxml2-dev libxslt-dev python-dev but it gave me another error:
sudo : Term 'sudo' not recognized as name of cmdlet, function, executable program or script file.
how can i install the lxml library without any problem occur?

when installing airflow, it occurs: subprocess-exited-with-error

os: centos7.6
python 3.8
occur error:
Collecting airflow
Using cached airflow-0.6.tar.gz (1.2 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute setup.py since setuptools is not available in the build environment.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
maybe this help
python -m pip uninstall setuptools
pip install setuptools
pip install airflow
This is simply saying the build tool setup.py fails to build from source.
I am not so technical in the aspect of building from source, so I can't tell you exactly what to do with your .tar.gz file to make it all right.
If you have pip installed on the machine (which I assume you do), then simply type:
pip install apache-airflow
The long version:
python3 -m pip install apache-airflow
If you intend to use celery together with Apache Airflow, I suggest:
python3 -m pip install apache-airflow[celery] for full installation.
Refer to the documentation of Apache Airflow for more info.

How to install jupyter- failed building wheel for pywinpty

I've been trying to install jupyter for the past 2 hours and I keep getting this error:
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pywinpty
Failed to build pywinpty
ERROR: Could not build wheels for pywinpty, which is required to install pyproject.toml-based projects
I tried installing pywinpty by itself (pip intstall pywinpty in cmd) and it gives the same wheels error.
I used this guide from jupyter to attempt installation: https://docs.jupyter.org/en/latest/install/notebook-classic.html
Just try using
python -m pip install --upgrade pip
If that doesn't work, Try this as Admin in cmd
pip uninstall pip
and then,
python -m ensurepip

As a pip install user, am I supposed to have wheel installed?

Consider the usual scenario - I want to create a virtual environment and install some packages. Say
python3 -m venv venv
source venv/bin/activate
pip install databricks-cli
During the installation, I get an error
Building wheels for collected packages: databricks-cli
Building wheel for databricks-cli (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/paulius/Documents/wheeltest/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-m7jmyh1m/databricks-cli/setup.py'"'"'; __file__='"'"'/tmp/pip-install-m7jmyh1m/databricks-cli/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-maxix98x
cwd: /tmp/pip-install-m7jmyh1m/databricks-cli/
Complete output (8 lines):
/tmp/pip-install-m7jmyh1m/databricks-cli/setup.py:24: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for databricks-cli
While it is benign (the installation actually works), it is still annoying.
I know that pip install wheel resolves this, but wheel does not come with the virtual environment by default. So should I always add it to my requirements.txt, or maybe this is something that can be solved by the package maintainer (in this case databricks-cli) and hence I should open an issue in their Github?
Update: note that the wheel is not necessary to install wheels, in this example bunch of dependencies get successfully downloaded and installed as wheels. The only databricks-cli package gets the error, as it does not have a wheel, but for some reason, pip tries to build it.
Update 3:
To prevent it from the maintainer's perspective use:
setup_requires=["wheel"]
it looks like you're on Linux and using the pre-installed or otherwise modified Python and its setuptools.
I've experienced the same thing due to Debian cutting off parts of the packages in not quite a sane way and I have mainly had issues with the prebuilt python-setuptools and likes. Check if the version matches and if not, install setuptools from pip, that might help in the future.
I have setuptools 45.2.0 and had no issues installing the package as a wheel. Then I uninstalled wheel and dropped the cache dir and it installed it properly even from the tar.gz source.
Update 2:
It might or might not be resolved by requiring wheel package. If the setup.py expects bdist_wheel to be present prior to the installation (most likely), adding it to the setup() function will not help and a manual check for the package within the setup script (+ perhaps a reference in README) are necessary so an end-user can install it properly.
For example if it's not present on the system, just print a warning and call an exit(). That would be the least a maintainer should do.
Update:
Yes, in the case where you encounter bdist_wheel command missing you need to install wheel with pip instal wheel.
It's not required, but it's recommended. Pip will work just fine without wheels, but you'll be installing from source (tar.gz, .zip or .egg).
See the packaging discussion for whether to use wheel or egg (or source).
This was a pip bug, and the solution is to upgrade the pip. With the newest version things look fine:
(venv) paulius#xps:~/Documents/wheeltest$ pip install databricks-cli
Collecting databricks-cli
Using cached databricks-cli-0.14.3.tar.gz (54 kB)
Collecting click>=6.7
Using cached click-8.0.1-py3-none-any.whl (97 kB)
Collecting requests>=2.17.3
Using cached requests-2.26.0-py2.py3-none-any.whl (62 kB)
Collecting six>=1.10.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting tabulate>=0.7.7
Using cached tabulate-0.8.9-py3-none-any.whl (25 kB)
Collecting idna<4,>=2.5
Using cached idna-3.2-py3-none-any.whl (59 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.6-py2.py3-none-any.whl (138 kB)
Collecting charset-normalizer~=2.0.0
Using cached charset_normalizer-2.0.1-py3-none-any.whl (35 kB)
Using legacy 'setup.py install' for databricks-cli, since package 'wheel' is not installed.
Installing collected packages: urllib3, idna, charset-normalizer, certifi, tabulate, six, requests, click, databricks-cli
Running setup.py install for databricks-cli ... done
Successfully installed certifi-2021.5.30 charset-normalizer-2.0.1 click-8.0.1 databricks-cli-0.14.3 idna-3.2 requests-2.26.0 six-1.16.0 tabulate-0.8.9 urllib3-1.26.6
Note the Using legacy 'setup.py install' ... line.
This is a related issue in the pip github https://github.com/pypa/pip/issues/8302. Not exactly that, but there is an explanation in the comments on what's the wheel building logic supposed to by.

Categories

Resources