Can't install pysam with pip in Python 3.6 - python

Macbook
Mac OSX 10.12.6
Python 3.6.2
cython 0.28.5
pip 18.0
I'm trying to install pysam:
pip3 install pysam
It keeps hitting an error at:
creating build/temp.macosx-10.6-intel-3.6/htslib/cram
htslib/cram/cram_io.c:63:10: fatal error: 'os/lzma_stub.h' file not found
#include "os/lzma_stub.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
Seems like this issue, this, and this were version issues. But I've tried pip3 install pysam==0.13 and 0.14 and 0.15 with the same results.
Suggestions?
I really don't want to deal with installing conda...

My mistake! pip3 install pysam==0.13 actually DOES work. Just leaving this here for posterity.

Clearly, you are missing lzma, which is now part of xz library (https://tukaani.org/xz/). Install that and see if it works. In OSX, you can install it using homebrew: brew install xz.
Another option is to install htslib (http://www.htslib.org/download/), or samtools (can be found in the htslib url).

Related

Installing Odoo on Mac raises gevent error

I'm following this tutorial to install Odoo 15 on Mac, but I'm getting this error when running pip install -r requirements.txt:
Error compiling Cython file:
------------------------------------------------------------
...
cdef load_traceback
cdef Waiter
cdef wait
cdef iwait
cdef reraise
cpdef GEVENT_CONFIG
^
------------------------------------------------------------
src/gevent/_gevent_cgreenlet.pxd:181:6: Variables cannot be declared with 'cpdef'. Use 'cdef' instead.
I have found several documents addressing cython errors, but none addressing the specific exception I'm getting.
this solved it for me:
pip install pip setuptools wheel Cython==3.0.0a10
pip install gevent==20.9.0 --no-build-isolation
if some problem with psycopg2 occurs, run this: (you can change 2.8.6 to 2.8.5 depending on what you need)
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib -L/opt/homebrew/opt/libpq/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include -I/opt/homebrew/opt/libpq/include"
pip3 install psycopg2==2.8.6
you might also need
brew install libpq --build-from-source brew install openssl
export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib -L/opt/homebrew/opt/libpq/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include -I/opt/homebrew/opt/libpq/include"
and if reportlab raises an installation error, try this:
CFLAGS="-Wno-error=implicit-function-declaration" pip install reportlab==3.5.55
Odoo 15 currently seems to be incompatible with Python 3.10.
You can get rid of that error by upgrading gevent/greenlet to newer versions in the requirements file. I've successfully tried gevent 21.12.0 and greenlet 1.1.3, BUT then you'll run into more trouble due to changes in the Python collections package.
Here is a link to the issue regarding the gevent error for reference.
Downgrade to Python 3.9.0 for the moment to continue with the installation.

ERROR: Failed building wheel for numpy , ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

I`m using python poetry(https://python-poetry.org/) for dependency management in my project.
Though when I`m running poetry install, its giving me below error.
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
I`m having python 3.9 installed in my laptop.
I installed numpy 1.21.5 using pip install numpy, I even tried to down version it to 1.19.5.
Though I`m getting the same error.
I found out many people are getting ERROR: Failed building wheel for numpy this error in python 3.10, they solved it by down versioning python to 3.9, though that didnt working for me.
I solved it by doing the following steps:-
I updated the pyproject.toml(This file contains all the library/dependency/dev dependency)with the numpy version that I installed using pip install numpy command.
Run poetry lock to update poetry.lock file(contains details information about the library)
Run poetry install again, & it should work fine.
If you are having any problems, you can comment.
I`ll try to answer it.
I had this trying to install numpy with PyPy on macOS.
I solved the issue by first running brew doctor, which showed that my Command Line Tools (XCode) were outdated. Then I just followed the instructions to update them:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
This solved the issue.
My configuration:
macOS 12.2.1 Monterey
> python --version
Python 3.8.12 (9ef55f6fc369, Oct 25 2021, 05:10:01)
[PyPy 7.3.7 with GCC Apple LLVM 13.0.0 (clang-1300.0.29.3)]
Numpy error solved
Error: failed to build wheels for numpy which is required to install project.tmol
This error cause due to outdated numpy version simply run this command
MATHLAB = "m" pip install numpy
`
My python version:
Python -V=3.9
It doesn't works in se case but most of the time works.
If you are working in venvthen try to install numpy in venv.
Then run your code it will be working
Fine.

pip install CrossMap failing on OSX: cannot find os/rand.c?

Just trying to run a
pip install CrossMap
on OSX 10.11.6 with a brew installed python (version 2.7.12) and pip (version 9.0.1) and running into this error:
htslib/hts_os.c:30:10: fatal error: 'os/rand.c' file not found
#include "os/rand.c"
^
1 error generated.
error: command 'clang' failed with exit status 1
I have looked everywhere for information on this error and it has come up empty. Where does this dependency come from and how do I install it?
Thanks!
CrossMap depends on pysam which is a wrapper for sam tools. You need to install htslib before compiling pysam.

Why is pip install pyopenssl==0.13 failing?

I'm trying to install PyOpenSSL 0.13 on my Macbook Pro (OSX version 10.11, El-Capitan). But it keeps failing. These are the steps I took
Download and install Command Line Tools (OSX 10.11) for Xcode 7.3.1 from here
$ virtualenv my-new-virtualenv
$ source my-new-virtualenv/bin/activate
$ pip install pyopenssl==0.13
When I do step #4, I get the following error:
OpenSSL/crypto/x509.h:17:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
----------------------------------------
Failed building wheel for pyopenssl
Here is the entire trace showing that error.
Why am I getting this error and how can I fix it??
It appears you are missing the OpenSSL development headers, as mentioned by #Klaus D. This most likely happened because due to upgrading to El Capitan, these development headers were broken. It can usually be fixed by reinstalling your command line tools.
If you have Homebrew, run this code:
brew install openssl
Also, just out of curiosity, is there a particular reason why you want to use version 0.13? When I did $ pip install pyopenssl==0.14 I got no errors. See the bit on pyOpenSSL's documentation:

Ubuntu : how to install matplotlib with python3.2 (freetype issue)

In this thread:
How to install matplotlib with Python3.2
the following is adviced:
git clone https://github.com/matplotlib/matplotlib
cd matplotlib
python3 setup.py build
sudo python3 setup.py install
but this does not work for me, as I get:
The following required packages can not be built:
freetype
I do not know what freetype is, but it does not seem to be in aptitude or pip.
I found the sources here:
https://github.com/rougier/freetype-py
but installing failed:
byte-compiling /usr/local/lib/python3.2/dist-packages/freetype/__init__.py to
init.cpython-32.pyc
File "/usr/local/lib/python3.2/dist-packages/freetype/init.py", line 39
raise RuntimeError, 'Freetype library not found'
^
SyntaxError: invalid syntax
but apparently that was to be expected, as freetype does not seem to be ok with python3.2:
https://code.google.com/p/freetype-py/issues/detail?id=11
As it seems to me other people manage to use matplotlib with python3, anything I am missing ?
ps : this did not work :
`Sudo pip install matplotlib` fails to find freetype headers. [OS X Mavericks / 10.9]
Found the issue.
My mistake was to look simply to look for a package called "freetype" instead of "libfreetype".
https://launchpad.net/ubuntu/+source/freetype

Categories

Resources