CellProfiler / python-bioformats

Read and write life sciences file formats
Other
130 stars 45 forks source link

ModuleNotFoundError: No module named 'numpy' when installing python-bioformats #169

Open d4nvjpl0ng4n opened 1 month ago

d4nvjpl0ng4n commented 1 month ago

When I try to instal python-bioformats, I get this error. ModuleNotFoundError: No module named 'numpy' Although I already did installed it. If I install python-bioformats without using "--use-pep517", I see a request to install with "--use-pep517".

C:\Users\Anh Duy\AppData\Local\Programs\Python\Python39\Scripts>pip install python-bioformats --use-pep517
Collecting python-bioformats
  Using cached python_bioformats-4.0.7-py3-none-any.whl.metadata (1.7 kB)
Collecting boto3>=1.14.23 (from python-bioformats)
  Using cached boto3-1.34.160-py3-none-any.whl.metadata (6.6 kB)
Collecting future>=0.18.2 (from python-bioformats)
  Using cached future-1.0.0-py3-none-any.whl.metadata (4.0 kB)
Collecting python-javabridge==4.0.3 (from python-bioformats)
  Using cached python-javabridge-4.0.3.tar.gz (1.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "c:\users\anh duy\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "c:\users\anh duy\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "c:\users\anh duy\appdata\local\programs\python\python39\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\Anh Duy\AppData\Local\Temp\pip-build-env-og5uafus\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "C:\Users\Anh Duy\AppData\Local\Temp\pip-build-env-og5uafus\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "C:\Users\Anh Duy\AppData\Local\Temp\pip-build-env-og5uafus\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\Anh Duy\AppData\Local\Temp\pip-build-env-og5uafus\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 412, in <module>
        File "<string>", line 100, in ext_modules
      ModuleNotFoundError: No module named 'numpy'
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

Please give me a solution to hanle this error.

macromeer commented 2 weeks ago

What worked for me was to build python-javabridge from source

sudo apt-get update sudo apt-get install build-essential

If you still need Java sudo apt update sudo apt install default-jdk echo $JAVA_HOME If empty, execute next line and also put it in ~/.bashrc export JAVA_HOME=/usr/lib/jvm/default-java

pip install --no-binary :all: python-javabridge==4.0.3

If you have version conflict with aibotocore and botocore: pip uninstall aiobotocore s3fs pip install aiobotocore~=2.5.0 pip install --upgrade boto3 botocore

pip install python-bioformats