LllC-mmd / SHAFTS

simultaneous extraction of building height and footprint
52 stars 8 forks source link

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

Open JonasZero opened 2 years ago

JonasZero commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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

landscapelc commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

landscapelc commented 1 year ago

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 commented 1 year ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 7 months ago

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:

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 commented 7 months ago

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.