I am trying to install mysqlclient in a centos system. These are some of the issues I am facing:
mysqlclient needs to be compiled in the installation system
to compile it, according to the official sources, we need python-devel and mysql-devel
what if I am installing mysqlclient in a virtualenv with python36? Do I need python36-devel instead of python-devel? Why is this not mentioned in the documentation?
will python36-devel match the python36 of my virtualenv? What if I am using my self-compiled python37 instead of the centos python36, will that match python36-devel? It's not like I have infinite options regarding the centos packages I can install ...
And some problems unrelated to mysqlclient, but related to centos:
centos does not have python36 by default. It seems something called epel-release must be installed.
python36-devel installs 36 (!!) dependencies:
--
Installed:
python36-devel.x86_64 0:3.6.8-1.el7
Dependency Installed:
dwz.x86_64 0:0.11-3.el7 groff-base.x86_64 0:1.22.2-8.el7 perl.x86_64 4:5.16.3-294.el7_6 perl-Carp.noarch 0:1.26-244.el7 perl-Encode.x86_64 0:2.51-7.el7 perl-Exporter.noarch 0:5.68-3.el7
perl-File-Path.noarch 0:2.09-2.el7 perl-File-Temp.noarch 0:0.23.01-3.el7 perl-Filter.x86_64 0:1.49-3.el7 perl-Getopt-Long.noarch 0:2.40-3.el7 perl-HTTP-Tiny.noarch 0:0.033-3.el7 perl-PathTools.x86_64 0:3.40-5.el7
perl-Pod-Escapes.noarch 1:1.04-294.el7_6 perl-Pod-Perldoc.noarch 0:3.20-4.el7 perl-Pod-Simple.noarch 1:3.28-4.el7 perl-Pod-Usage.noarch 0:1.63-3.el7 perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 perl-Socket.x86_64 0:2.010-4.el7
perl-Storable.x86_64 0:2.45-3.el7 perl-Text-ParseWords.noarch 0:3.29-4.el7 perl-Time-HiRes.x86_64 4:1.9725-3.el7 perl-Time-Local.noarch 0:1.2300-2.el7 perl-constant.noarch 0:1.27-2.el7 perl-libs.x86_64 4:5.16.3-294.el7_6
perl-macros.x86_64 4:5.16.3-294.el7_6 perl-parent.noarch 1:0.225-244.el7 perl-podlators.noarch 0:2.5.1-3.el7 perl-srpm-macros.noarch 0:1-8.el7 perl-threads.x86_64 0:1.87-4.el7 perl-threads-shared.x86_64 0:1.43-6.el7
python-rpm-macros.noarch 0:3-24.el7 python-srpm-macros.noarch 0:3-24.el7 python3-rpm-macros.noarch 0:3-24.el7 redhat-rpm-config.noarch 0:9.1.0-87.el7.centos zip.x86_64 0:3.0-11.el7
Utterly broken, if you ask me.
Related
I was installing firebase-admin using pip on my raspberry pi 3b+ using the following command:
pip3 install firebase-admin
However it always ends with an error saying "Error building wheel for cryptography"
Here is the full error message:
/tmp/pip-build-env-k7qo7p54/overlay/lib/python3.7/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning: Installing 'cryptography.hazmat.bindings._rust' as data is deprecated, please list it in packages.
!!
############################
# Package would be ignored #
############################
Python recognizes 'cryptography.hazmat.bindings._rust' as an importable package,
but it is not listed in the `packages` configuration of setuptools.
'cryptography.hazmat.bindings._rust' has been automatically added to the distribution only
because it may contain data files, but this behavior is likely to change
in future versions of setuptools (and therefore is considered deprecated).
Please make sure that 'cryptography.hazmat.bindings._rust' is included as a package by using
the `packages` configuration field or the proper discovery methods
(for example by using `find_namespace_packages(...)`/`find_namespace:`
instead of `find_packages(...)`/`find:`).
You can read more about "package discovery" and "data files" on setuptools
documentation page.
!!
check.warn(importable)
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust
Python: 3.7.3
platform: Linux-5.10.103-v7+-armv7l-with-debian-10.13
pip: n/a
setuptools: 67.0.0
setuptools_rust: 1.5.2
rustc: n/a
=============================DEBUG ASSISTANCE=============================
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
This package requires Rust >=1.48.0.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
I have tried different commands like:
pip3 install firebase-admin
or
python -m pip install firebase-admin
I have upgraded pip and tried again, but still it didn't work
I faced a similar problem long time ago and solved by installing openssl. Tried it this time, it didn't work
Also tried installing rust compiler and using it but it didn't work
I am using Raspbian OS Buster on my Raspberry Pi 3
I have tried fresh installs of the OS
Still the same problem occurs
We have some issues deploying our GCP Dataflow pipeline. After some analysis, found that the latest version of apache-beam has some issues while installing. To replicate the issue I created a virtualenv and ran the below
pip install apache-beam==2.32.0
Below errors started to pop while installing the 'orjson' dependency,
Using cached orjson-3.6.3.tar.gz (548 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: 'c:\temp\virtu\scripts\python.exe' 'c:\temp\virtu\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\prasasaw\AppData\Local\Temp\tmpmekx1jjj'
cwd: C:\Users\prasasaw\AppData\Local\Temp\pip-install-0yofoe55\orjson_62f1ca2674934a7f8c45b08e87e05a4b
Complete output (6 lines):
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Note that the previous versions of Apache beam like 2.30.0 does not have the dependency on 'orjson' and it works just fine when you do
pip install apache-beam==2.30.0
I tried to install RUST but it failed for some 'pysam' dependency. So would like to know what is the correct way to install the 'orjson' dependency
I saw this GitHub issue for orjson installation but could not find much from it.
https://github.com/readthedocs/readthedocs.org/issues/7687
//Prasad.
I'm a bit late to the party, but I ran into this issue as well today. I solved it by switching to a 64-bit Python environment (I accidently installed 32-bit).
The orjson dependency was introduced in https://github.com/apache/beam/pull/14690/files. According to the comment: orjson, only available on Python 3.6 and above. You may want to check your python version.
According to the orjson docs, you need to upgrade pip to be above 20.3:
pip install --upgrade "pip>=20.3" # manylinux_x_y, universal2 wheel support
pip install --upgrade orjson
(docs)
It appears that policycoreutils-python requires higher versions of
the packages : libsemanage-python, auditlibs-python and python-IPy, than the default versions of these packages I have installed on a Centos server (Rocks 6.1). I thought that updating the version of Python would help since the default Python version on the server is 2.6.6.
I installed Python 3.5 by following another answer:
yum install https://centos6.iuscommunity.org/ius-release.rpm
and then installing python35u through yum.
Since 3.5 is not default and only one of the python versions available, I am not sure how to make yum use this version while installing policycoreutils-python.
I am interested in installing policycoreutils-python because I want to update the version of GCC to >=4.7 through the developer toolset package
released by the Scientific Linux community.
My questions are therefore:
1. How do I get policycoreutuils-python installed?
2. Is it a good idea to update several different packages on the server, in the process? I am really new to Centos and I am not sure how to find packages
when yum reports that they are not available. What is the best practice - install from source?
1) CentOS 6.5 is too old to be updated. I.e. please run # yum update every week. CentOS 6.5 was released 'Dec 2013' ! ( And no 'yum install [package] will work anymore ? ? ).
2) Generally always use yum for any package install. And : policycoreutils-python is included in the *Base.repo http://mirror.centos.org/centos/6.8/os/x86_64/Packages/ . And : a package search should always be used : # yum search policycoreutils-python ... i.e. # yum search [name] , or [part of name] .
3) If your old CentOS 6.5 works anyway, the right policycoreutils-python etc. will be installed automatically when installing gcc-4.7 : # yum install devtoolset-1.1-gcc-c++ ... : You don't need to install the complete devtoolset-1.1 .
Important : The slc6-devtoolset.repo must be setup beforehand : # wget -O /etc/yum.repos.d/slc6-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc6-devtoolset.repo
Ref. http://linux.web.cern.ch/linux/devtoolset/
I'm trying to install sqlalchemy to interact with mysql database for my python 3.x with ubuntu 12.04, but then when I import the sqlalchemy it says no module named sqlalchemy. This is what i did with installation:
aoi#aoi:~$ sudo apt-get install python3-sqlalchemy
[sudo] password for aoi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libgio-cil libmono-corlib4.0-cil libmono-system-security4.0-cil libmono-system-xml4.0- cil libmono-i18n-west4.0-cil cli-common guile-1.8-libs
libmono-system-configuration4.0-cil librhythmbox-core5 mono-runtime libgdu-gtk0 libavahi-ui-gtk3-0 mono-4.0-gac mono-gac
linux-headers-3.5.0-23-generic libglib2.0-cil linux-headers-3.5.0-23 libming1 thunderbird-globalmenu libmusicbrainz3-6 libmono-i18n4.0-cil
libmono-security4.0-cil libmono-system4.0-cil
Use 'apt-get autoremove' to remove them.
Suggested packages:
python-sqlalchemy-doc
The following NEW packages will be installed:
python3-sqlalchemy
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 450 kB of archives.
After this operation, 2,808 kB of additional disk space will be used.
Get:1 http://ph.archive.ubuntu.com/ubuntu/ precise-updates/main python3-sqlalchemy all 0.7.4-1ubuntu0.1 [450 kB]
Fetched 450 kB in 40s (11.0 kB/s)
Selecting previously unselected package python3-sqlalchemy.
(Reading database ... 346102 files and directories currently installed.)
Unpacking python3-sqlalchemy (from .../python3-sqlalchemy_0.7.4-1ubuntu0.1_all.deb) ...
Setting up python3-sqlalchemy (0.7.4-1ubuntu0.1) ...
Did I do something wrong?
This gets ya sqlalchemy version 0.8.4 for python 2.x
ubuntu is a lot slow in keeping packages up to date
sudo apt-get install python3-sqlalchemy
So for Python 3 / Ubuntu peeps here is how to install the latest version of sqlalchemy
sudo apt-get install python3-pip
# Now you have pip3
sudo apt-get install python3-all-dev
# Required for sqlalchemy's c extensions to be installed
sudo pip3 install SQLAlchemy
# note using pip, not pip3, will install for Python 2.7
:~$ python3
>>> import sqlalchemy
>>> sqlalchemy.__version__
>>> '0.9.8'
>>> print("Who's the man?")
>>> You are baby!
>>> quit()
By using apt-get you have installed sqlalchemy in the default directory for Ubuntu's default Python 3, which is 3.2. If you search in the directory /usr/lib/python3/dist-packages you'll find the sqlalchemy module (or just type locate sqlalchemy). However, this isn't where a custom Python will look for its modules. You'll need to download the source and compile it with the correct Python, something like /opt/python3.3/bin/python3.3 setup.py install in the source directory for sqlalchemy. See the instructions here: http://docs.python.org/3.3/install
It seems that the python3-sqlalchemy is outdated. You can try to use pip3 to get the latest version instead.
sudo pip3 install sqlalchemy
should do the trick.
I am just starting with virtualenv, but I am trying to install gevent within a virtualenv environment (I am running Windows). When I use PIP from virtualenv, I get this error:
MyEnv>pip install gevent
Downloading/unpacking gevent
Running setup.py egg_info for package gevent
Please provide path to libevent source with --libevent DIR
The package index has MSIs and EXEs for installing on Windows (http://pypi.python.org/pypi/gevent/0.13.7), but I don't know how to install those into a virtualenv environment (or if that is even possible). When I try pip install gevent-0.13.7.win32-py2.7.exe from the virtualenv promp, I get an error as well:
ValueError: ('Expected version spec in', 'D:\\Downloads\\gevent-0.13.7.win32-py2.7.exe', 'at', ':\\Downloads\\gevent-0.13.7.win32-py2.7.exe')
Does someone know how to do this?
Pip doesn't support installing binary packages, yet. If you want to install from binary package you have to use easy_install - easy_install gevent-0.13.7.win32-py2.7.exe
Microsoft Windows XP [Wersja 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
Z:\>virtualenv z:\venv\gevent-install
New python executable in z:\venv\gevent-install\Scripts\python.exe
Installing distribute..................................................................................................
............................................................................................done.
Installing pip.................done.
Z:\>venv\gevent-install\Scripts\activate
(gevent-install) Z:\>easy_install c:\python\packages\gevent-0.13.7.win32-py2.7.exe
Processing gevent-0.13.7.win32-py2.7.exe
creating 'c:\docume~1\pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg' and adding 'c:\docume~1
pdobro~1\ustawi~1\temp\easy_install-b5nj3i\gevent-0.13.7-py2.7-win32.egg.tmp' to it
creating z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Extracting gevent-0.13.7-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding gevent 0.13.7 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\gevent-0.13.7-py2.7-win32.egg
Processing dependencies for gevent==0.13.7
Searching for greenlet
Reading http://pypi.python.org/simple/greenlet/
Reading http://bitbucket.org/ambroff/greenlet
Reading https://github.com/python-greenlet/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/2.7/g/greenlet/greenlet-0.3.4-py2.7-win32.egg#md5=9941aa246358c586bb274812e
130629
Processing greenlet-0.3.4-py2.7-win32.egg
creating z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Extracting greenlet-0.3.4-py2.7-win32.egg to z:\venv\gevent-install\lib\site-packages
Adding greenlet 0.3.4 to easy-install.pth file
Installed z:\venv\gevent-install\lib\site-packages\greenlet-0.3.4-py2.7-win32.egg
Finished processing dependencies for gevent==0.13.7
(gevent-install) Z:\>
See Can I install Python windows packages into virtualenvs? Another option is to install from source and you can do this with pip but this requires setting up compiler and environment which is much harder than the simple command above.
From the error message, it would appear you need libevent source code. I would imagine you need to go a step further and compile/install libevent system-wide so pip can find it.
I would start by downloading the latest stable source from http://libevent.org/.
Compile and install it using instructions in the README: https://github.com/libevent/libevent#readme
To compile it on Windows, you'll need to use GNU-style build utilities like make and autoconf. I recommend http://www.mingw.org/.
Once you've installed libevent system-wide, I imagine pip will find it and proceed with gevent installation.
In the msi for gevent-0.13.7 there's an option to select an alternate installation point. point it to the root dir of your particular virtual environment (just above where /Lib and /Scripts are located). That should install it correctly.
You also need to make sure greenlets are installed. For that you can use Piotr's suggested method with easy_install on the .exe.