rajanil / fastStructure

A variational framework for inferring population structure from SNP genotype data.
MIT License
132 stars 51 forks source link

fastStructure can not import "allelefreq" module #56

Open JingjingYang1226 opened 4 years ago

JingjingYang1226 commented 4 years ago
I had trouble in the using of  fastSTRUCTURE. The dependence of Numpy, Scipy, and Cython were installed by  pip of conda. GSL-2.3 were also installed successful, and the library was added to bash_profile.
 I had installed the fastSTRUCTURE step by step according to the instruction. However, when I typed pthon structure.py,  it appeared that fastStructure can not import "allelefreq" module.  I had checked the vars directory, it seemed that the "allelefreq" module were installed.
I don't known what's wrong.  I had provided the IMAGE in the attachment.

python structure.py

Traceback (most recent call last): File "structure.py", line 3, in import fastStructure File "fastStructure.pyx", line 2, in init fastStructure import numpy as np File "admixprop.pyx", line 1, in init admixprop ImportError: No module named allelefreq

Vars direcrory

admixprop.c allelefreq.c build init.pyc README admixprop.h allelefreq.h C_admixprop.c marglikehood.c setup.py admixprop.pxd allelefreq.pxd C_allelefreq.c marglikehood.h utils.c admixprop.pyx allelefreq.pyx C_marglikehood.c marglikehood.pyx utils.pyx admixprop.so allelefreq.so init.py marglikehood.so utils.so

yaominzoe commented 4 years ago

I am getting this as well when I try to run the testing dataset. Have you found a solution to this problem?

yaominzoe commented 4 years ago

wow,you could try this method: https://gist.github.com/josiahaltschuler/a063e03b4197013def53f9a0abc6dfed It works for me.

dslater82 commented 3 years ago

I tried the method from https://gist.github.com/josiahaltschuler/a063e03b4197013def53f9a0abc6dfed but I still receive "ImportError: No module named allelefreq". I am using Python 2.7.13 with numpy 1.16.5, scipy 0.19.0, and 0.29.14. Any ideas?

jawzman7 commented 3 years ago

I am getting the same issue...no module named allelefreq...Did anyone figure it out?????

VarIr commented 3 years ago

Following the guide works for me. I created a virtualenv to ensure the exact package versions stated in the guide. Do you have GSL installed and did you set LD_LIBRARY_PATH, CFLAGS, and LDFLAGS according to the guide (adapted for your individual paths)?

camhilker commented 3 years ago

I'm having the same issue. I updated my bash profile and compiled the cython scripts as outlined in the README file. Any help is appreciated! I'm using python 2.7, numpy 1.16.6, scipy 1.2.1, cython 0.29.14.

jawzman7 commented 3 years ago

I got it to work when I created a python environment to work in

jawzman7 commented 3 years ago

a python virtual environment like Varlr suggested.

Nguyen205 commented 2 years ago

I solved this problem by editing the three paths (LD_LIBRARY_PATH, CFLAGS, and LDFLAGS) in .bashrc. Note that the CFLAGS path was slightly different from the methods above. It should be the path containing the .h files. Mine was: xxx/gsl/include/gsl rather than xxx/gsl/include. The other two paths should be the path containing the .so files, which was the same as the methods provided by other people. After doing that, I deleted the entire proj folder and redid the installation following the readme file. After all these steps, it worked for me.

StuntsPT commented 1 year ago

Hi everyone, I have a stop-gap solution if you are on a GNU/Linux based or macOS platform. I am the developer of Structure_threader, which contains a pre-compiled fastStructure binary for both mentioned platforms. You can either install Structure_threader using pip (python3 -m pip install structure_threader --user), or you can get the binary file directly here for GNU/Linux, or here for macOS X (not tested on the latest ARM based macs, though).

Of course the only real solution to this issue is porting fastStructure to python3... but I do hope this helps, though.