ksamuk / pixy

Software for painlessly estimating average nucleotide diversity within and between populations
https://pixy.readthedocs.io/
MIT License
117 stars 14 forks source link

Installing pixy using "pip install pixy" doesn't yield "pixy" executable #34

Closed niemasd closed 3 years ago

niemasd commented 3 years ago

Describe the bug Installing pixy using pip install pixy didn't yield a pixy executable in my PATH

The pixy command and error message I tried installing pixy as follows:

$ sudo -H pip3 install pixy

It installed fine, which I can confirm because I can import the pixy Python package just fine:

>>> import pixy # this runs fine without any errors

However, when I try to run pixy from bash, there's no such executable in my PATH:

$ pixy

Command 'pixy' not found, did you mean:

  command 'pixz' from deb pixz

Try: sudo apt install <deb name>

It seems like the pixy version that is installed using pip is version 1.0.2, so perhaps that's why? I tried uninstalling pixy:

$ sudo -H pip3 uninstall pixy

And then installing using pip but from the commit of the most recent GitHub release:

$ sudo -H pip3 install git+https://github.com/ksamuk/pixy.git@478d8f230ed8060b96e4fcf77d80102707781a02

That didn't work either:

ERROR: Could not find a version that satisfies the requirement python (from pixy) (from versions: none)
ERROR: No matching distribution found for python

OS information

Sample files N/A

niemasd commented 3 years ago

I think I found the issue with installing the most recent release using pip. In setup.py, python is listed in the requirements list (line 7), but the requirements list is only supposed to contain Python packages. I ended up just downloading the latest release tarball, deleting this single line from setup.py

$ wget -qO- "https://github.com/ksamuk/pixy/archive/refs/tags/1.1.1.beta1.tar.gz" | tar -zx
$ vi pixy-1.1.1.beta/setup.py # I deleted line 7: 'python',
$ sudo -H pip3 install ~/pixy-1.1.1.beta/

This worked fine, and the pixy executable is now in my PATH:

$ pixy -h
usage: pixy [-h] --stats {pi,dxy,fst} [{pi,dxy,fst} ...] --vcf [VCF]
            --populations [POPULATIONS] [--window_size [WINDOW_SIZE]]
            [--bed_file [BED_FILE]] [--n_cores [N_CORES]]
            [--output_folder [OUTPUT_FOLDER]]
            [--output_prefix [OUTPUT_PREFIX]] [--chromosomes [CHROMOSOMES]]
            [--interval_start [INTERVAL_START]]
            [--interval_end [INTERVAL_END]] [--sites_file [SITES_FILE]]
            [--chunk_size [CHUNK_SIZE]] [--fst_type {wc,hudson}]
            [--bypass_invariant_check {yes,no}] [--version] [--citation]
            [--silent]

█▀▀█ ░▀░ █░█ █░░█
█░░█ ▀█▀ ▄▀▄ █▄▄█
█▀▀▀ ▀▀▀ ▀░▀ ▄▄▄█
pixy: unbiased estimates of pi, dxy, and fst from VCFs with invariant sites
1.1.1.beta1
...
niemasd commented 3 years ago

I've created a pull request with this edit: https://github.com/ksamuk/pixy/pull/35

ksamuk commented 3 years ago

Awesome! Thanks for flagging this and for the PR. That file is auto-generated and so was under my radar.