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

TypeError: expected str, bytes or os.PathLike object, not NoneType #4

Open
rbogusze opened this issue May 23, 2022 · 9 comments
Open

Comments

@rbogusze
Copy link

Unable to install pemja on raspberry pi, tried with python 3.7 and 3.9

Steps to reproduce:

$ virtualenv -p /usr/bin/python3.9 venv3.9
$ source venv3.9/bin/activate      
$ python --version
Python 3.9.0
$ pip --version
pip 22.1.1 from /home/pi/venv3.9/lib/python3.9/site-packages/pip (python 3.9)

$ pip install pemja

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pemja
  Downloading pemja-0.1.5.tar.gz (32 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-iqprsatx/pemja_afa58ffaf082492bb729b5377e1491da/setup.py", line 185, in <module>
          include_dirs=get_java_include() + ['src/main/c/pemja/core/include'] + get_numpy_include(),
        File "/tmp/pip-install-iqprsatx/pemja_afa58ffaf082492bb729b5377e1491da/setup.py", line 112, in get_java_include
          inc = os.path.join(get_java_home(), inc_name)
        File "/home/pi/venv3.9/lib/python3.9/posixpath.py", line 76, in join
          a = os.fspath(a)
      TypeError: expected str, bytes or os.PathLike object, not NoneType
      [end of output]

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

Same error here, someone resolved this?

@zhjdotxmsme
Copy link

on window platform same error as is, but install successful on macos platform

@lucasfonsecads
Copy link

@alexzhu0592 Could you share how you resolved it on macOS?

@zhjdotxmsme
Copy link

@alexzhu0592 Could you share how you resolved it on macOS?

no errors on macos, just install by normal way like pip install pemja

@zhjdotxmsme
Copy link

@alexzhu0592 Could you share how you resolved it on macOS?

Maybe you can check your jdk version or python version which doc suggests

@HuangXingBo
Copy link
Collaborator

What's the os and hardware? m1 chip?

@andrew-nippard
Copy link

Seems to be an issue with how environment variable JAVA_HOME is set on some machines (i.e. I'm using a M1 chip + Linux).

The below command worked for me:
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64

@Haaroon
Copy link

Haaroon commented Dec 9, 2022

Okay so i did alot of testing with @jamesalford and it seems this is an error because of python 3.10.

If you install with python3.9 pemja installs fine.

it has nothing to do with java_home being set or not, but its a python issue

Python3.10 works if you set a JAVA_HOME to a working java, otherwise it crashes with NoneType

@YasuoStudyJava
Copy link

YasuoStudyJava commented Aug 9, 2023

well,I met the issue in Python3.7,and because the source code of pemja set to find 'JAVA_HOME', so I set 'JAVA_HOME' to solve the problem. Then install pemja successfully.

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

7 participants