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

MacOS Installation Issues Fixed #280

Closed

Conversation

sanam2405
Copy link

  • Dependencies related to python and numpy are fixed
  • Instructions to add path to poetry while using a bash shell are added

@exook @fritjof-b

@fritjof-b
Copy link
Contributor

Hi @sanam2405 , please try to avoid editing the Python in the pyproject.toml file, we've just tailored it because there is an underlying bug in PyTorch which affects the choice of Python version (see 40acf8d and 4186f63).

There is actually some difference between .bashrc, .bash_profile, and .profile, which you can read about here. Because of this, sourcing any of those files has no effect if poetry is not correctly prepended to the PATH variable in the files themselves. This is a fault of the guide.

We've had this discussion earlier, but I don't believe we (Baler team) should own any setup of specific software such as WSL or Poetry. That setup should be left to those individual organisations. This leads me to believe that we should remove (or heavily alter) this guide completely, and rather direct users to https://python-poetry.org.

Adding numpy does not have any effect, as it is a "dependency of a dependency" (see attached screenshots).
Screenshot 2023-06-28 at 14 27 24
Screenshot 2023-06-28 at 14 27 32

As an endnote, I know you mentioned that you use an M1 Mac, which works fine (I do as well), and that if you had any installation issues you could reach out on Slack. Therefore I'll probably reject this PR. :-)

Wdyt @exook

@sanam2405
Copy link
Author

sanam2405 commented Jun 28, 2023

Hey @fritjof-b, while installing baler on my M1 Mac, the issues I faced are as follows :-

  1. There was no file named .profile

Fix I used - I noticed that I was using a bash terminal and I did not have a .profile file. Instead I had a .bash_profle file. On further exploring I got to know about the .bashrc .bash_profile and .profile files. Also the blog you provided cleared things more.

Check that I don't have a .profile file here but I do have .bash_profile which I used.
Screenshot 2023-06-28 at 6 32 09 PM

  1. While running the below command

poetry run python baler --project CFD_workspace CFD_project_animation --mode train

I got the error ModuleNotFoundError: No module named 'numpy'

Fix I used - I noticed there is no numpy mentioned in thepyproject.tomlfile. So I ran the command: poetry add numpy
On running the command I got into another error that said python versions are mismatching. So I manually resolved this by assigning the python version as python = "^3.9" which fixed the issue. Then I ran the command poetry add numpy again and it ran successfully. The changes that were made once this command ran are -

  • numpy was added in the pyproject.toml file as numpy = "^1.25.0"
  • changed the poetry.lock file

Once these changes were made, I could run baler for compressing and decompressing the CFDs.

I suggest that numpy version be added in the [tool.poetry.dependencies] in the pyproject.toml file, or otherwise add an instruction saying to run the command poetry add numpy as it shall show any dependency conflicts or missing dependencies related to numpy or python version.

Presently, I ran baler on Linux (Ubuntu) as well. To sum, these two changes in the [tool.poetry.dependencies] section in the pyproject.toml file should resolve dependency conflicts and missing for both macOS on ARM and Linux.

  • python = ">=3.8, <3.11"
  • numpy = "^1.25.0"

@fritjof-b
Copy link
Contributor

fritjof-b commented Jun 28, 2023

@sanam2405 To me it looks like you're using zsh, not bash. zsh is the default shell on macOS. To confirm you can run:

echo $0

You're also using conda, which can be seen from your prompt and config files. Conda probably interferes with your environment and poetry. There is no way for me to debug this on your computer.

I installed Poetry and Baler on a fresh macOS installation a couple of days ago (and before) and did not run into the problems you are facing. These facts increase the probability that there is something not "right" with your local setup. There is no way for me to debug this for you.

To give you some things to look into:

  • How did you install python?
  • How are you managing python versions and virtual environments?
  • Is Anaconda interfering with Poetry?

Edit: The python versioning error you ran into has to do with your local configuration of Python, and not how Baler is set up.

@sanam2405
Copy link
Author

@fritjof-b I just checked and I confirmed that I am using zsh shell and not bash

  • I installed my python using pip. Before installing and using poetry, I have been using pip as my package manager
  • I am using poetry to manage versions and virtual environments as of now
  • I am not sure but I do not think that Anaconda should interfere with Poetry

The python versioning error popped up both in case of my macOS and Linux. The error got removed on changing the version from python = "^3.8" to python = ">=3.8, <3.11"

As an end note, I think the installation guide for python should include some direct reference link to poetry and avoid instructions that are specific to a particular machine, architecture or shell.

@fritjof-b fritjof-b closed this Jun 30, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants