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

installation issue on Mac #329

Closed
lhuntneuro opened this issue Aug 2, 2024 · 7 comments · Fixed by #330 or #331
Closed

installation issue on Mac #329

lhuntneuro opened this issue Aug 2, 2024 · 7 comments · Fixed by #330 or #331

Comments

@lhuntneuro
Copy link

I've tried to install OSL on a Mac following the installation instructions page, using the osl.yml file to set up a new conda environment.

The conda environment sets up fine, and OSL is downloaded, but when I try to import I get the following issue:

>>> import osl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/anaconda3/envs/osl/lib/python3.8/site-packages/osl/__init__.py", line 28, in <module>
    from . import utils  # noqa: F401, F403
  File "/opt/anaconda3/envs/osl/lib/python3.8/site-packages/osl/utils/__init__.py", line 15, in <module>
    with open(os.path.join(os.path.dirname(__file__), "README.md"), 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/opt/anaconda3/envs/osl/lib/python3.8/site-packages/osl/utils/README.md'

It looks like when I created the conda environment, all the .py files were correctly installed into /opt/anaconda3/envs/osl/lib/python3.8/site-packages/osl/, but none of the README.md files - which then causes a problem for the import. Is this a known issue, and is there a straightforward workaround?

@cgohil8
Copy link
Collaborator

cgohil8 commented Aug 2, 2024

What directory were you in when you launched python? Did do the last step:

pip install -e .

@lhuntneuro
Copy link
Author

lhuntneuro commented Aug 2, 2024

Thanks Chet, I was just in my home directory but I seem to get the same issue irrespective of where I run it.

I was just installing with the lines:

curl https://raw.githubusercontent.com/OHBA-analysis/osl/main/envs/mac-full.yml > osl.yml
conda env create -f osl.yml
rm osl.yml

using my pre-existing anaconda install - I didn't think from reading https://osl.readthedocs.io/en/latest/install.html that I needed to run

pip install -e . 

unless I was pulling the latest source code?

I imagine if I pull the source code using git clone, it will pull all the readme files and the above issue will disappear - so I'll try that - but just wanted to check I wasn't doing something stupid with the main installation instructions using the osl.yml file

@cgohil8
Copy link
Collaborator

cgohil8 commented Aug 2, 2024

What you did is correct and should have been fine (i.e. you shouldn't need to do pip install -e .). The issue's probably on our side. What Mac do you have? In particular, what chip do you have?

@cgohil8
Copy link
Collaborator

cgohil8 commented Aug 2, 2024

I've been able to reproduce the error on my M2 Mac. We'll solve this in the next release.

In the meantime maybe it would be worthwhile to clone the repo and install that in your environment:

conda activate osl
git clone https://github.com/OHBA-analysis/osl.git
cd osl
pip install -e .

@lhuntneuro
Copy link
Author

OK thanks - mine is a M1 Pro Mac, running Sonoma 14.5.

@cgohil8
Copy link
Collaborator

cgohil8 commented Aug 2, 2024

Installing the repo with the above code should work. Otherwise, this has been resolved for the next release (v0.9, which will happen in the next few days).

@cgohil8
Copy link
Collaborator

cgohil8 commented Aug 3, 2024

Alright, v0.9.0 has been released and I tested the installation on my Mac. Should work fine now. Thanks for raising the issue.

Please reopen this issue if this has not been resolved for you.

@cgohil8 cgohil8 linked a pull request Aug 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants