Issues with pysam install on an AWS EC2

39 views
Skip to first unread message

Tony Lee

unread,
Feb 11, 2022, 3:52:51 PM2/11/22
to Pysam User group

Hello,

I have set up an EC2 instance in AWS with the Ubuntu AMI and am trying to use pysam in it. I have noticed that the `pip install pysam` command does not seem to take into account any of the environment variables. I tested this by:

`export HTSLIB_CONFIGURE_OPTIONS=--disable-libcurl`
`pip install pysam`

But when attempting to run the following: `tbxFile = pysam.TabixFile("https://path/to/a/file", index="https://path/to/a/file"+".tbi", mode="r")`, it doesn't say that the file was not found but rather recognizes that it's an HTTPS protocol file. I am testing this because I am trying to enable S3 paths for my pysam install.

Has anyone had any experience with installing pysam on an EC2 machine?

Peter Cock

unread,
Feb 11, 2022, 5:23:46 PM2/11/22
to pysam-us...@googlegroups.com
I believe the configure optons will only take effect if building pysam from source.

You would need to tell pip NOT to use a pre-compiled wheel (which it would do be default as that's much faster to install).

Peter

--
You received this message because you are subscribed to the Google Groups "Pysam User group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysam-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysam-user-group/8df1744f-fd05-466b-b23a-dd4d2c5294c7n%40googlegroups.com.

Chrystelle Delord

unread,
Feb 12, 2022, 2:53:32 AM2/12/22
to Pysam User group
Dear all,

Please allow me to join that thread, as I suspect I might having similar environment variable issues when trying to install pysam (on Windows 10, in my case).

I set the environment variable HTSLIB as "HTSLIB_CONFIGURE_OPTIONS=--enable-plugins", and ran "pip install pysam --no-binary :all: ".
However I get the following error message:

    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Sidon\anaconda3\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Sidon\\AppData\\Local\\Temp\\pip-install-7oik8ti3\\pysam_69a73ad532754832a1ca4f62fe4ef9ec\\setup.py'"'"'; __file__='"'"'C:\\Users\\Sidon\\AppData\\Local\\Temp\\pip-install-7oik8ti3\\pysam_69a73ad532754832a1ca4f62fe4ef9ec\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Sidon\AppData\Local\Temp\pip-pip-egg-info-vr9xlh8r'
         cwd: C:\Users\Sidon\AppData\Local\Temp\pip-install-7oik8ti3\pysam_69a73ad532754832a1ca4f62fe4ef9ec\
    Complete output (23 lines):
    # pysam: cython is available - using cythonize if necessary
    # pysam: htslib mode is shared
    # pysam: HTSLIB_CONFIGURE_OPTIONS=None
    '.' n'est pas reconnu en tant que commande interne
    ou externe, un programme ex‚cutable ou un fichier de commandes.
    '.' n'est pas reconnu en tant que commande interne
    ou externe, un programme ex‚cutable ou un fichier de commandes.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Sidon\AppData\Local\Temp\pip-install-7oik8ti3\pysam_69a73ad532754832a1ca4f62fe4ef9ec\setup.py", line 320, in <module>
        htslib_make_options = run_make_print_config()
      File "C:\Users\Sidon\AppData\Local\Temp\pip-install-7oik8ti3\pysam_69a73ad532754832a1ca4f62fe4ef9ec\setup.py", line 71, in run_make_print_config
        stdout = subprocess.check_output(["make", "-s", "print-config"])
      File "C:\Users\Sidon\anaconda3\lib\subprocess.py", line 424, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "C:\Users\Sidon\anaconda3\lib\subprocess.py", line 505, in run
        with Popen(*popenargs, **kwargs) as process:
      File "C:\Users\Sidon\anaconda3\lib\subprocess.py", line 951, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Users\Sidon\anaconda3\lib\subprocess.py", line 1420, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
    FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable
    # pysam: htslib configure options: None
    ----------------------------------------

I am not very at easy with Python and C++, so not sure about what is actually going on here?

Thank you very much for your help,

Best regards,
Chrys
Reply all
Reply to author
Forward
0 new messages