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

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.

Related

Issues installing python package on windows

I'm trying to install python-rocksdb on a windows 10 machine and I'm coming across some issues with the install.
I have successfully installed rocksdb first using the vcpkg method.
When running pip install python-rocksdb I get the following error:
cl : Command line error D8021 : invalid numeric argument '/Wextra'
error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
Looking around suggested attempting to install with GCC or G++, so I downloaded cygwin and then attempted to install the python package using
pip install --global-option build_ext --global-option --compiler=cygwin python-rocksdb which yielded the following error:
gcc: error: unrecognized command-line option ‘-mcygwin’
error: command 'C:\\cygwin64\\bin\\gcc.exe' failed with exit code 1
This post seems to suggest that you need to use g++ specifically, but it looks like the cygwin command is defaulting to gcc.
Just note that I'm not using the virtual env with python.
Any assistance is greatly appreciated.

unable to install psycopg2 on python3

I'm trying to install psycopg2 module on python3 on a CentOS Linux 7 and getting the following error
In file included from psycopg/psycopgmodule.c:28:0:
./psycopg/psycopg.h:36:22: fatal error: libpq-fe.h: No such file or directory
#include <libpq-fe.h>
^
compilation terminated.
It appears you are missing some prerequisite to build the package from source.
You may install a binary package by installing 'psycopg2-binary' from PyPI.
If you want to install psycopg2 from source, please install the packages
required for the build and try again.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
error: command 'gcc' failed with exit status 1
Any ideas as to what the solution would be?
Thanks

Unable to install tesserocr on Mac

I'm trying to install tesserocr with the command:
pip install tesserocr
but I'm getting this error:
tesserocr.cpp:298:10: fatal error: 'utility' file not found
#include <utility>
^~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
I have installed tesseract using: brew install tesseract
I'm using Mojave 10.14.3.
Try this one: CC=clang XCC=clang++ CPPFLAGS="-stdlib=libc++ -DUSE_STD_NAMESPACE -mmacosx-version-min=10.8" pip install tesserocr. It works fine for me.
And this original answer is from https://github.com/sirfz/tesserocr/issues/177.
Good Luck!

Can't install pysam with pip in Python 3.6

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).

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:

Categories

Resources