Git Product home page Git Product logo

Comments (12)

aphearin avatar aphearin commented on August 16, 2024

Hi @olakusiak I haven't encountered this error message before but sorry this is giving you trouble. It looks like the cython extensions are not being recognized for some reason. Have you tried installing through the conda-forge channel? That usually ensures internally consistent dependencies of all relevant packages.

I just double-checked on my local machine (which is also macOS Catalina 10.15.7) and I can compile and install using cython 0.29.22. So in case using the conda-forge channel does not resolve the issue (or in case you already were using conda-forge when you tried installing into a virtualenv) then would you mind trying downgrading to cython 0.29.22 to see if that solves the problem?

from halotools.

borisbolliet avatar borisbolliet commented on August 16, 2024

Hi,

I am encountering the same issue on my Mac.
Downgrading to Cython 0.29.22 didn't solve the issue :/ (same error message as above)

Boris

from halotools.

aphearin avatar aphearin commented on August 16, 2024

Ok, thanks for confirming the problem @borisbolliet - are you also using pip or have you tried installing with conda?

from halotools.

olakusiak avatar olakusiak commented on August 16, 2024

thanks @aphearin for the suggestions. I tried both conda-forge and downgrading cython, and none helped

from halotools.

aphearin avatar aphearin commented on August 16, 2024

Ok thanks for the diligence @olakusiak. I'm having trouble reproducing the error locally, but I'll keep trying. In the meantime, would you be able to supply a full error/build log?

from halotools.

aphearin avatar aphearin commented on August 16, 2024

Ok I just tried the following environment configuration and installation test on a macOS Catalina 10.15.7:

$ conda create -n testenv python=3.7 halotools=0.7 h5py ipython jupyter matplotlib cython pytest-astropy
$ conda activate testenv
$ ipython
>>> import halotools
>>> halotools.test_installation()

When I call the installation test within the testenv environment as above, I get no errors. Would you mind trying again using this same virtual conda environment?

from halotools.

olakusiak avatar olakusiak commented on August 16, 2024

@aphearin that works perfectly, thank you! (I was also able to install it without any trouble with pip on a cluster)

from halotools.

aphearin avatar aphearin commented on August 16, 2024

Ok, great! I wonder if maybe the problem was resolved by installing pytest-astropy? I'll update the installation docs to include that from now on. In any case, please do let me know if you encounter any other problems with v0.7 by reopening this issue and tagging me.

from halotools.

borisbolliet avatar borisbolliet commented on August 16, 2024

Somehow I am still encountering the same error. I attach the error log:
error.log
(I am working with Ola so we can figure out together)
Thank you so much for the fast response!

from halotools.

aphearin avatar aphearin commented on August 16, 2024

Hmm, @borisbolliet is it possible that you are executing the test suite from within the root halotools directory that contains the source code of halotools? I'm not sure, but I think that is what the following lines of your error log indicates:

platform darwin -- Python 3.7.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/boris/Work/CLASS-SZ/SO-SZ/halotools, configfile: setup.cfg

If that is the case, then this would produce this error, so could you try repeating the same call to the installation test, exactly as you have done, but first cd into some other working directory that is separate from the halotools repo:

$ conda create -n testenv python=3.7 halotools=0.7 h5py ipython jupyter matplotlib cython pytest-astropy
$ conda activate testenv
$ cd /some/random/working/directory/away/from/halotools
$ ipython
>>> import halotools
>>> halotools.test_installation()

from halotools.

borisbolliet avatar borisbolliet commented on August 16, 2024

That works ! very good

Thank you so much,
Boris

from halotools.

aphearin avatar aphearin commented on August 16, 2024

Ok, glad this is resolved @borisbolliet. Just FYI, here is what was happening. This has to do with the general way the python interpreter handles your paths and not halotools per se.

Whenever you initiate an import of some module/package, the interpreter first looks in your current local directory for that package. If it does not find it, then it moves to the next location in your path sequence. In your case here, you had a local copy of halotools in your working directory, and so the interpreter looked there, but since that local copy did not have the cython extensions built (or just not self-consistently built), then you got an import error. By moving outside of halotools and trying again, the interpreter moved on down your path sequence until it found the copy of halotools that was installed to your conda directory. This version had the extensions properly built, and so you could import the package without problems.

The upshot is this: once you have installed some package into an environment, typically you should write your code and do the work that uses that package in some location besides the package source code location.

I hope this helps clarify the mysterious error message. Let me know if you encounter any other issues in getting your analysis off the ground.

from halotools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.