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

When I install shaft with pip, there is an error. #7

Open
JonasZero opened this issue Apr 20, 2022 · 13 comments
Open

When I install shaft with pip, there is an error. #7

JonasZero opened this issue Apr 20, 2022 · 13 comments
Assignees

Comments

@JonasZero
Copy link

JonasZero commented Apr 20, 2022

ImportError: sh 1.11 is currently only supported on linux and osx. please install pbs 0.110 (http://pypi.python.org/pypi/pbs) for windows support. The system I am using is Windows.
Snipaste_2022-04-20_22-57-33

@LllC-mmd
Copy link
Owner

Thanks for your interest in SHAFTS.
Did you install SHAFTS by conda on Windows?
We have tested the installation of SHAFTS on a Windows machine by Anaconda from a newly created environment with GDAL and Fiona preinstalled and no error has been reported. If you don't install SHAFTS by conda, we recommend you do so.

@landscapelc
Copy link

Hello, I also encountered the same problem under Windows system.
I have successfully installed GDAL and Fiona.
When I tried to install the shaft using Conda, I still encountered an error.
a323b0998266a08ca50b2aa6ce0280b
May I ask how I should solve this problem?

@sunt05
Copy link
Collaborator

sunt05 commented Oct 9, 2023

Hi @landscapelc , SHAFTS is not yet available as a conda package so please follow our instruction for installation.

@landscapelc
Copy link

Thank you for your reply!I have installed SHAFTS successfully.
But I also encountered another error as follows:
4afb21d6ed86d4c895f63ebeb16beb8
I guess it may be a version issue. I wonder if it would be convenient for you to provide version information for TensorFlow and Keras?

@sunt05
Copy link
Collaborator

sunt05 commented Oct 9, 2023

Hi @LllC-mmd can we please add the version info of tensorflow required by shafts? Probably we may specify this in the setup.py file.

@LllC-mmd
Copy link
Owner

OK. We will try to fix the issues of Tensorflow with our newest model in this week.

@landscapelc
Copy link

Thank you, I notice that the model has been modified. But I also encountered the same error as I mentioned above.
I will provide a detailed description of my operational steps as follows:
python3 -m pip install shaft --upgrade
If I run this command, I will get the following results:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
python -m pip install shaft --upgrade
If I run this command, I will get the same error as the problem initiator:
36c64faeb7861b2261b6f040dd9ef0e
python -m pip install shafts --upgrade
If I run this command, there will be no problem.
python data_download.py
But when I run this command, the error still exists:
e56e116364d51b41b5cd11cfb8f2ffb

@mblgn
Copy link

mblgn commented Oct 26, 2023

Thank you, I notice that the model has been modified. But I also encountered the same error as I mentioned above. I will provide a detailed description of my operational steps as follows: python3 -m pip install shaft --upgrade If I run this command, I will get the following results: Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. python -m pip install shaft --upgrade If I run this command, I will get the same error as the problem initiator: 36c64faeb7861b2261b6f040dd9ef0e python -m pip install shafts --upgrade If I run this command, there will be no problem. python data_download.py But when I run this command, the error still exists: e56e116364d51b41b5cd11cfb8f2ffb

I met the same issue

@aleaicr
Copy link

aleaicr commented Dec 13, 2023

Hi @landscapelc , SHAFTS is not yet available as a conda package so please follow our instruction for installation.

Hello,
I've been trying all day to install SHAFTS following the installation instructions and have encountered the same issues as the other users.

First, I installed Anaconda and in using its navigator I installed both fiona and gdal packages into the base environment as @LllC-mmd said. Then, I opened the base terminal and executed the command that you provided in the instructions pip install shaft and I get the same error with 'Collecting sh==1.11' as @JonasZero and @landscapelc reported.

Subsequently, I visited the Pypi project website https://pypi.org/project/shafts/#description (not sure if this is the same project, can you confirm?) and I noted a difference in the command, in the website its pip install shafts (it has a final 's'). I ran this command in the same base terminal, and it successfully installed the package. But data_download.py in the example folder is still not working, pycharm says that there is still not a "shaft" package.

I also tried running the python setup.py (I don't know how to install using this file)
image

And finally, I ran it using python setup.py install command:
image

What did I miss? Any help with the installation?

@sunt05 sunt05 self-assigned this Dec 13, 2023
@sunt05
Copy link
Collaborator

sunt05 commented Dec 13, 2023

Thank you for your interest in our package!

We've updated the installation instructions in the README – please give it another go and continue to post here if you encounter any more issues.

@sunt05
Copy link
Collaborator

sunt05 commented Dec 19, 2023

Hi @aleaicr, please let us know if the issue persists.
If so, please provide more info for us to address the issue. Otherwise, please close the issue.

@aleaicr
Copy link

aleaicr commented Mar 27, 2024

Sorry, I'm back again trying to install SHAFTS.

Now, I'm almost done installing SHAFTS on Windows Subsystem for Linux (Ubuntu) with the new instructions for installation. Here are the steps I did:

  • I installed conda and mamba on the WSL.
  • I created the environment using the env.yml file with the command provided in the instructions (and activated the environment)
  • I installed SHAFTS via pip install shafts in the Ubuntu terminal.
  • I cloned the repository using git clone .....

However, when I execute make test in the root directory of the cloned repository I encounter the following issue:

(SHAFTS_env) User@Host:~/Desktop/SHAFTS$ ls
Makefile  README.md  env.yml  example  src
(SHAFTS_env) User@Host:~/Desktop/SHAFTS$ make test
conda init bash
no change     /home/User/anaconda3/condabin/conda
no change     /home/User/anaconda3/bin/conda
no change     /home/User/anaconda3/bin/conda-env
no change     /home/User/anaconda3/bin/activate
no change     /home/User/anaconda3/bin/deactivate
no change     /home/User/anaconda3/etc/profile.d/conda.sh
no change     /home/User/anaconda3/etc/fish/conf.d/conda.fish
no change     /home/User/anaconda3/shell/condabin/Conda.psm1
no change     /home/User/anaconda3/shell/condabin/conda-hook.ps1
no change     /home/User/anaconda3/lib/python3.11/site-packages/xontrib/conda.xsh
no change     /home/User/anaconda3/etc/profile.d/conda.csh
no change     /home/User/.bashrc
No action taken.
make -C src test
make[1]: Entering directory '/home/User/Desktop/SHAFTS/src'
pip install -e .
Obtaining file:///home/User/Desktop/SHAFTS/src
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      Traceback (most recent call last):
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/_normalization.py", line 61, in safe_version
          return str(packaging.version.Version(v))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/_vendor/packaging/version.py", line 198, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      setuptools.extern.packaging.version.InvalidVersion: Invalid version: '2023.4.'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/home/User/Desktop/SHAFTS/src/setup.py", line 18, in <module>
          setup(
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/__init__.py", line 104, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 147, in setup
          _setup_distribution = dist = klass(attrs)
                                       ^^^^^^^^^^^^
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/dist.py", line 298, in __init__
          self.patch_missing_pkg_info(attrs)
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/dist.py", line 287, in patch_missing_pkg_info
          dist._version = _normalization.safe_version(str(attrs['version']))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/_normalization.py", line 64, in safe_version
          return str(packaging.version.Version(attempt))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/User/anaconda3/envs/SHAFTS_env/lib/python3.12/site-packages/setuptools/_vendor/packaging/version.py", line 198, in __init__
          raise InvalidVersion(f"Invalid version: '{version}'")
      setuptools.extern.packaging.version.InvalidVersion: Invalid version: '2023.4.'
      ver_milestone    2023
      ver_major           4
      ver_minor          25
      ver_remark
      dtype: object
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
make[1]: *** [Makefile:42: test] Error 1
make[1]: Leaving directory '/home/User/Desktop/SHAFTS/src'
make: *** [Makefile:47: test] Error 2
(SHAFTS_env) User@Host:~/Desktop/SHAFTS$ 

I believe there's an issue with the version of something (invalid version 2023.4).

I tried it twice and encountered the same results. The first time I created the environment by installing env.yml. In the second instance I created it and then installed packages one by one.

Hi @aleaicr, please let us know if the issue persists. If so, please provide more info for us to address the issue. Otherwise, please close the issue.

Should I open a new issue for this? I didn't create this one, so I can't close it.

@sunt05
Copy link
Collaborator

sunt05 commented Mar 27, 2024

Could you please downgrade to Python 3.11 and try again?

Also, if you have installed shafts via pip, then no need to go through pip install -e . for a dev version.

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

6 participants