Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing module errors #63

Open
konradtaube opened this issue Feb 25, 2021 · 2 comments
Open

Missing module errors #63

konradtaube opened this issue Feb 25, 2021 · 2 comments

Comments

@konradtaube
Copy link

I apologize if this is a long post, but I want to be thorough! I am trying to run a file through fastStructure, which I am doing in the command line like so:
python structure.py -K 3 --input=/home/FM/ktaube/Downloads/plink1.09/masters-p1-vmac2.bed --output=home/FM/ktaube/Downloads/fastStructure/vmac2-p1-structureoutput --full --seed=100

This is giving me the following error:

Traceback (most recent call last):
  File "structure.py", line 3, in <module>
    import fastStructure
  File "fastStructure.pyx", line 2, in init fastStructure
    import numpy as np
ModuleNotFoundError: No module named 'vars.admixprop'

One thing to note: I had tried python structure.py -K 3 --input=/home/FM/ktaube/Downloads/plink1.09/masters-p1-vmac2.bed --output=home/FM/ktaube/Downloads/fastStructure/vmac2-p1-structureoutput --full --seed=100 before, and was getting issues with the program needing parenthesis around messages from the print function, so I actually went in and added the parenthesis so each print message was correct. That brings us to the following issue.

Googling around, I found that I may need to build a library extension, so I did the following:

cd vars
python setup.py build_ext --inplace

Which gives me the following message:

_running build_ext
skipping 'utils.c' Cython extension (up-to-date)
Warning: Extension name 'admixprop' does not match fully qualified name 'vars.admixprop' of 'admixprop.pyx'
Warning: Extension name 'allelefreq' does not match fully qualified name 'vars.allelefreq' of 'allelefreq.pyx'
Warning: Extension name 'marglikehood' does not match fully qualified name 'vars.marglikehood' of 'marglikehood.pyx'
Compiling admixprop.pyx because it depends on /home/FM/ktaube/miniconda3/lib/python3.8/site-packages/Cython/Includes/numpy/__init__.pxd.
Compiling allelefreq.pyx because it changed.
Compiling marglikehood.pyx because it changed.
[1/3] Cythonizing allelefreq.pyx

Error compiling Cython file:
------------------------------------------------------------
...
        # use an iterative fixed-point solver to update parameter estimates.
        var_beta, var_gamma = self._unconstrained_solver(Dvarbeta, Dvargamma)

        # if a variable violates positivity constraint,
        # set it to an estimate from the previous update
        bad_beta = reduce(utils.OR,[(var_beta<=0),np.isnan(var_beta)])
                  ^
------------------------------------------------------------

allelefreq.pyx:148:19: undeclared name not builtin: reduce
Traceback (most recent call last):
  File "setup.py", line 25, in <module>
    ext_modules = cythonize(ext_modules)
  File "/home/FM/ktaube/miniconda3/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1039, in cythonize
    cythonize_one(*args)
  File "/home/FM/ktaube/miniconda3/lib/python3.8/site-packages/Cython/Build/Dependencies.py", line 1161, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: allelefreq.pyx_

Any help would be really appreciated!

@WilfriedWoeber
Copy link

Hi,
I think you have a Python3 issue. Do the following:

git clone https://github.com/jashapiro/fastStructure.git
cd fastStructure
git checkout py3
cd ..

This clones the Python3 fastStructure version of jashapiro (I appreciate his work!).

Afterwards the installation described in the Readme works.

All the best from Vienna

@anjlapastora
Copy link

Hi,
I think you have a Python3 issue. Do the following:

git clone https://github.com/jashapiro/fastStructure.git
cd fastStructure
git checkout py3
cd ..

This clones the Python3 fastStructure version of jashapiro (I appreciate his work!).

Afterwards the installation described in the Readme works.

All the best from Vienna

this step really helps. I had the same problem as stated above. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants