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

make install fails #37

Closed
hagenw opened this issue Aug 10, 2021 · 7 comments
Closed

make install fails #37

hagenw opened this issue Aug 10, 2021 · 7 comments

Comments

@hagenw
Copy link

hagenw commented Aug 10, 2021

I first started by running (inside my virtual environment that I used before to run omnizart):

$ poetry install
$ python -m pytest

which results in errors as the checkpoint files are stored under ~/.local/.../site-packages/ as described in CONTRIBUTING.md.

I then switched to start from scratch by deactivating my virtual environment and running:

$ make install

but this fails with:

Installing the current project: omnizart (0.4.1)
./scripts/install.sh: line 109: omnizart: command not found
Makefile:57: recipe for target 'install' failed
make: *** [install] Error 127
@BreezeWhite
Copy link
Member

I'm not sure whether you use conda or python-venv as your virtual environment. The command poetry install will create its own virtual environment if there is no .venv directory (which can be created by running python -m venv .venv). And if you are using conda, there could be conflict with poetry.

Could you also try running ./script/install.sh directly, instead of make install and see what happens?

@hagenw
Copy link
Author

hagenw commented Aug 16, 2021

I deleted the .venv folder and created it with

$ virtualenv .venv

Then I executed

$ ./scripts/install.sh
...
Installing the current project: omnizart (0.4.1)
./scripts/install.sh: line 109: omnizart: command not found

@hagenw
Copy link
Author

hagenw commented Aug 16, 2021

I continued by running the following commands manually:

$ source .venv/bin/activate
$ omnizart download-checkpoints

But if I then start running the tests, they still fail, because pytest is not installed.

@BreezeWhite
Copy link
Member

The first problem is caused by the existence of .venv directory, which will be automatically used by poetry while installing everything. And this behavior contradicts the original intention that by directly executing ./scripts/install.sh without arguments, it should install dependencies on the system and will not activate the virtualenv during installation. This will broken at the line 109, which the omnizart is installed under .venv, but the installation is not using that virtualenv. The bug could be fixed by modifying the installation script I think, by adding poetry config virtualenvs.in-project false to line 54.

And for the missing package of pytest, it is defined as a development dependency, which should be manually installed by running poetry install. This is indicated in the last line of section Download and install in CONTRIBUTING.md.

@hagenw
Copy link
Author

hagenw commented Aug 20, 2021

So the problem is that I named the virtual environment .venv?

I'm still wondering what a proper solution should/could be as the indicated way in CONTRIBUTING.md is not working for me.

@BreezeWhite
Copy link
Member

According to the document of poetry here, yes.

You mean make install not working?

@hagenw
Copy link
Author

hagenw commented Aug 20, 2021

I started now from scratch.

I made sure that no .venv folder existed and no virtual environment was activated and then run:

$ make install
$ poetry install
$ source .venv/bin/activate
$ python -m pytest

And it worked.

So, I guess the guide in CONTRIBUTING.md is correct.
Will close this issue.

@hagenw hagenw closed this as completed Aug 20, 2021
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

2 participants