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

Version information required for pip install #39

Closed
alexlyttle opened this issue Aug 4, 2023 · 16 comments
Closed

Version information required for pip install #39

alexlyttle opened this issue Aug 4, 2023 · 16 comments

Comments

@alexlyttle
Copy link
Contributor

alexlyttle commented Aug 4, 2023

It appears pip requires version info to install. The setup.py script sets version=None which no longer works.

Problem

I'm having some issues installing isoclassify using the pip functionality. I'm getting this error and I was wondering if you could help.
Screen Shot 2023-08-03 at 2 22 33 PM

Originally posted by @SpaceyCaseyLynn in #30 (comment)

Solution

Set version in setup.py.

This is an easy fix, I'm on it!

@alexlyttle
Copy link
Contributor Author

alexlyttle commented Aug 4, 2023

@SpaceyCaseyLynn I think the issue should be fixed now, but I couldn't reproduce it exactly on my system.

Could you see if my changes have fixed the issue? To do so, run the following code in your terminal,

git clone -b version https://github.com/alexlyttle/isoclassify.git
cd isoclassify
pip install .

This will clone my 'fixed' version of isoclassify and attempt to pip install it. Please let me know if it works or not.

You may continue following installation instructions with my fixed version of isoclassify until Pull Request #40 is merged with the main version. It should work the same.

@SpaceyCaseyLynn
Copy link

SpaceyCaseyLynn commented Aug 7, 2023 via email

@SpaceyCaseyLynn
Copy link

Whoops, looks like the error message didn't attach over email! Here it is
Screen Shot 2023-08-07 at 10 58 06 AM

@alexlyttle
Copy link
Contributor Author

Thanks for letting me know @SpaceyCaseyLynn. Just got back from vacation so only just saw this. I will try and reproduce this soon and get back to you.

@alexlyttle
Copy link
Contributor Author

Unfortunately, I cannot reproduce your error message. Could you attach the output of pip list and conda list?

In the meantime, you could try pip uninstall isoclassify and then go through the installation instructions again. The error message implies the isoclassify package has not been installed, which is a bit odd.

@ashleychontos
Copy link

Something similar just happened to me after successfully installing the software with my new(er) python version (3.10):

Screenshot 2023-11-09 at 4 51 58 PM

@ashleychontos
Copy link

ashleychontos commented Nov 9, 2023

I tried another fresh install and I think the issue may be with how the setup function is defined because it installs copies of the isoclassify.direct and isoclassify.grid folders in the source directory (see attached) **edit: the entire isoclassify/ directory is copied in the source directory. Presumably this is confusing the software with where to look for specific packages (you can see that the distribution info is also saving within the source directory too):

Screenshot 2023-11-09 at 5 12 58 PM

@SpaceyCaseyLynn
Copy link

SpaceyCaseyLynn commented Nov 9, 2023 via email

@ashleychontos
Copy link

Hey Case,

I'm glad you figured out a temporary hack to get it working on your computer!

I was mostly pointing this out so it can hopefully be fixed in newer updates/versions i.e. so you don't have to have your computer point to an older version. The setup function defines the console point, so I actually didn't even have the ISOCLASSIFY environment defined in the bashrc (for me, zsh) file (since this really should be avoided anyway). In the meantime, I'll use the older version you linked so I can at least get some stellar parameters :)

Ashley

@SpaceyCaseyLynn
Copy link

SpaceyCaseyLynn commented Nov 9, 2023 via email

@alexlyttle
Copy link
Contributor Author

Thanks for the update @ashleychontos and @SpaceyCaseyLynn! I can look into potential fixes for this. If either of you want a go at fixing instead feel free and let me know, I'm happy to help where possible!

@ashleychontos
Copy link

To expand on what I mean by duplicated items, first shown is a fresh copy of Dan's git repo:

Screenshot 2023-11-09 at 6 08 14 PM

Then after cd'ing into the isoclassify/ directory and running pip install ., the current setup.py file creates duplicates of all files in isoclassify/isoclassify in the main isoclassify/ repo:

Screenshot 2023-11-09 at 6 09 13 PM

In order to diagnose the main issue, perhaps it would be helpful to use different names for the main and subdirectories. I think the copying of all files at both levels could easily make this a very difficult problem to pin down.

@alexlyttle
Copy link
Contributor Author

alexlyttle commented Nov 10, 2023

I still cannot reproduce the error, but have an idea of why you both might be seeing it.

Did you clone the isoclassify repo directly into your .../python3.10/site-packages directory? If so then I think that is where the issue comes from. The site-packages directory is where Python puts packages when you pip install them. If you put the package source code in site-packages, then that would explain the duplication issue. Since the package is already there, pip just puts a copy of it there.

Try cloning the repo somewhere else (e.g. directly into your home directory). Then go through the install instructions.
If you want to clone my fix for the version number bug then clone my working branch git clone -b version https://github.com/alexlyttle/isoclassify.git.

If I'm wrong or that doesn't work let me know and I'll keep digging!

If we add the package to PyPI then you can just pip install it without cloning the repository and that will stop this from happening.

P.S. if this fixes the issue I'll suggest updating the REAME to be clearer

@ashleychontos
Copy link

Ok so I did what you suggested and it works now, but there are still two copies on my computer. I deleted the local copy and it appears that the command-line help is still working -> which bring me to my final question: It seems like you've already put in the actual work to easily make this possible, so why not make it pip-installable to prevent people from having to make the two copies on their computer?

Either way, thanks for helping me out. I agree having something about not running it from python site-packages would be helpful.... as someone who used to be very bad at keeping python packages in one place (and now religiously does it). I thought I was doing the right thing by cloning it there only to make things worse!

@alexlyttle
Copy link
Contributor Author

It seems like you've already put in the actual work to easily make this possible, so why not make it pip-installable to prevent people from having to make the two copies on their computer?

Absolutely, that would be great! I am not the repository maintainer so would need to run this by @danxhuber. This involves uploading the package to PyPI. Ideally, it would be uploaded after Dan or another maintainer merges PR #40 (the version number fix), as I don't have permission to merge it.

If you just ran pip install . and did not use the -e flag, then you can just delete your clone of the repository and the package will still work. Then you won't have multiple copies on your computer.

Either way, thanks for helping me out. I agree having something about not running it from python site-packages would be helpful....

You're welcome! Yeah, it can get messy very quickly, especially if using virtual environment or conda. But it's not wrong to put code in site-packages when it doesn't need to be build with pip install. Really, our README needs to be clearer!

@danxhuber
Copy link
Owner

Thanks all, this has now been implemented and the code is pip-installable.

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

4 participants