I am running Python under windows.
I face no problem in installing pysqlite package.
C:\>c:\Python26\Scripts\easy_install.exe pysqlite
Searching for pysqlite
Reading http://pypi.python.org/simple/pysqlite/
........
Download error: [Errno 11001] getaddrinfo failed -- Some packages may not be found!
Reading http://initd.org/tracker/pysqlite/wiki/PysqliteDownloads
........
Best match: pysqlite 2.5.6
Downloading http://pysqlite.googlecode.com/files/pysqlite-2.5.6.win32-py2.6.exe
Processing pysqlite-2.5.6.win32-py2.6.exe
WARNING: can't process DATA/pysqlite2-doc/default.css
WARNING: can't process DATA/pysqlite2-doc/docutils.css
WARNING: can't process DATA/pysqlite2-doc/install-source.txt
creating 'c:\docume~1\yan-ch~1.che\locals~1\temp\easy_install-5wz15q\pysqlite-2.5.6-py2.6-win32.egg' and adding 'c:\docume~1\ya
n-ch~1.che\locals~1\temp\easy_install-5wz15q\pysqlite-2.5.6-py2.6-win32.egg.tmp' to it
Moving pysqlite-2.5.6-py2.6-win32.egg to c:\python26\lib\site-packages
Adding pysqlite 2.5.6 to easy-install.pth file
Installed c:\python26\lib\site-packages\pysqlite-2.5.6-py2.6-win32.egg
Processing dependencies for pysqlite
Finished processing dependencies for pysqlite
However, I fail to install psycopg
C:\>c:\Python26\Scripts\easy_install.exe psycopg
Searching for psycopg
Reading http://pypi.python.org/simple/psycopg/
Reading http://initd.org/projects/psycopg1
Best match: psycopg 1.1.21
Downloading http://initd.org/pub/software/psycopg/psycopg-1.1.21.tar.gz
Processing psycopg-1.1.21.tar.gz
error: Couldn't find a setup script in c:\docume~1\yan-ch~1.che\locals~1\temp\easy_install-recnw8\psycopg-1.1.21.tar.gz
Is there other alternative?
Thanks!
The psycopg PyPi posting does not contain a pre-built w32 installer that easy_install can use nor could it find a way to build from source.
Here are some pre-built versions of the psycopg module.
easy_install only knows how to install modules distributed with the Python standard distribution and packaging solution called distutils. Psycopg is not. Psycopg is instead installed with the so called CMMI dance: configure/make/make install. Doing that on Windows is tricky, hence, you need to download a precompiled version, see Christians answer.
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
While getting the documentation of a python repository right, I stumpled upon the issue that the package requirement shapely cannot be install on ReadTheDocs (RTD).
The log says:
Searching for shapely
Reading https://pypi.python.org/simple/shapely/
Best match: Shapely 1.6a1
Downloading https://pypi.python.org/packages/83/3b/99d5d0e266c3bf5f361c76ff046a539eaf96a4e9ca1beaef5121dcaf5cdc/Shapely-1.6a1.tar.gz#md5=a2efe87371d8186f5cbeadc0c153c546
Processing Shapely-1.6a1.tar.gz
Writing /tmp/easy_install-7zplo9iy/Shapely-1.6a1/setup.cfg
Running Shapely-1.6a1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7zplo9iy/Shapely-1.6a1/egg-dist-tmp-t5eb3ob8
Failed `CDLL(libgeos_c.so.1)`
Failed `CDLL(libgeos_c.so)`
error: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so']
The actual problem is that libgeos is missing on RTD which is required to install shapely. Usually, you install libgeos by sudo apt-get install libgeos-dev. This does not work on RTD.
Does someone has any clue on that? In particular, I'm looking for a solution how to tell RTD to install additional system packages. I'm curious if this is possible at all.
RTD does not support installing additional c libs as stated in their FAQs, there's a discussion about this issue on git.
As written in the FAQ, you can only "mock out" these libs to avoid import errors.
In python 2.7.10,
Could not find a version that satisfies the requirement mysqldb(from version)
no matching distribution found for mysqldb
pip install MySQL-python also failed: Unable to find vcvarsall.bat and many other errors if I am patching solution for this one.
Building Python libraries on Windows can be challenging.
This message indicates that the Visual C++ compiler cannot be found:
Unable to find vcvarsall.bat
You could install Visual Studio Express and try again, or use another compiler as suggested in the referenced question. But you may find that this leads to further problems, e.g. now the MySQL headers can't be found.
Manually installing MySQL from source will likely fix that issue, but that might reveal its own dependency problems.
Instead of going through this rigmarole you might consider installing precompiled versions from Christoph Gohlke.
I'm struggling with installing MySQL-python on my Centos VPS. I have "main" Python 2.6 (one that came automatically with CentOS) and another one I installed after (2.7). So I used this command:
easy_install-2.7 MySQL-python
But it reproduces following error:
Searching for MySQL-python
Reading https://pypi.python.org/simple/MySQL-python/
Download error on https://pypi.python.org/simple/MySQL-python/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'MySQL-python' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for MySQL-python
error: Could not find suitable distribution for Requirement.parse('MySQL-python')
Thanks for reading my question and possibly trying to help!
Perhaps you're using an old version of easy_install, that may be the root of problem. You can follow instructions from distribute doc package, and than install pip. Since you have installed pip you can install MySQL-pythoneasily.
Maybe try use some sentence,which include mysqldb.
Installing MySQLDb (Python module) without Internet Connection
Hi all,
I need to install MySQLDb on a SLES 11 Development Server. This Dev Server does not have access to the public internet due to corporate firewall policies. I was assuming this would merely be a nuisance which would force me to do source installations etc on things more easily installed otherwise. Instead, I have hit a wall, during my attempt to ultimately install and run Django with MySQL support.
I have downloaded and unzipped MySQL-python-1.2.4, and I am attempting to run its setup.py. However, any attempt to run setup.py, even just sudo python setup.py --help, reults in the following
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
And then of course the download fails.
I downloaded and installed the current version of the distribute module (0.7.3), via sudo python setup.py build install. I assumed this would keep mysql-python's setup.py from trying to download distribute. But that does not appear to matter. I did have a quick look at mysql-client's setup.py to see where the download was being forced. It appears that its setup.py does this:
from distribute_setup import use_setuptools
use_setuptools()
Which calls this:
def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
to_dir=os.curdir, download_delay=15, no_fake=True):
# making sure we use the absolute path
to_dir = os.path.abspath(to_dir)
was_imported = 'pkg_resources' in sys.modules or \
'setuptools' in sys.modules
try:
try:
import pkg_resources
if not hasattr(pkg_resources, '_distribute'):
if not no_fake:
_fake_setuptools()
raise ImportError
except ImportError:
return _do_download(version, download_base, to_dir, download_delay)
And this, the import of pkg_resources fails (I have reproduced this from the command line); and the exception handler tries a download, which of course fails.
My understanding is that distribute is deprecated anyway, and that setuptools should be used instead. I do have setuptools installed; but is the mysqldb module hardcoded to use distribute, and possibly a specific version of distribute, and that's my issue? To be honest at this point I'm a bit confused about modules, dependencies, etc in Python (I'm quite mediocre at Python).
Thanks all,
Bean
git clone https://github.com/PyMySQL/PyMySQL or download tarball. for mysqldb: https://github.com/farcepest/MySQLdb1
untar it
run sudo python setup.py install
That's all.
Guess it's too late, but for the sake of the future googlers...
I had the same problem. To solve it I had to comment these lines:
if not hasattr(pkg_resources, '_distribute'):
if not no_fake:
_fake_setuptools()
raise ImportError
After this I was able to install MySQL-python via python setup.py install.
The answer to this question appears to be version dependent. MySQLDb version 1.2.5 (newest version as of this writing) and later do not require distribute so python setup.py install will work. Version 1.2.5 was released 01/2014 so this question is just that old.