I'm trying to import tinyobjloader in my PyOpenGL project on PyCharm for an assignment, but I keep getting this error
ModuleNotFoundError: No module named 'tinyobjloader'
I've installed tinyobjloader with pip3 on my Mac.
When I try to install the package in the PyCharm preferences, I get this:
Collecting tinyobjloader
Using cached tinyobjloader-0.1.tar.gz (3.1 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: tinyobjloader
Building wheel for tinyobjloader (setup.py): started
Building wheel for tinyobjloader (setup.py): finished with status 'error'
Running setup.py clean for tinyobjloader
Failed to build tinyobjloader
Installing collected packages: tinyobjloader
Running setup.py install for tinyobjloader: started
Running setup.py install for tinyobjloader: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /Users/assignment2/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/setup.py'"'"'; __file__='"'"'/private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-wheel-41q_dg59
cwd: /private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/
Complete output (11 lines):
running bdist_wheel
running build
running build_ext
creating build
creating build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I../ -I../pybind11/include -I/Users/assignment2/venv/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c bindings.cc -o build/temp.macosx-10.9-x86_64-3.8/bindings.o -std=c++11
bindings.cc:1:10: fatal error: 'pybind11/pybind11.h' file not found
#include "pybind11/pybind11.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for tinyobjloader
ERROR: Command errored out with exit status 1:
command: /Users/assignment2/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/setup.py'"'"'; __file__='"'"'/private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-record-_ftffefa/install-record.txt --single-version-externally-managed --compile --install-headers /Users/assignment2/venv/include/site/python3.8/tinyobjloader
cwd: /private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/
Complete output (13 lines):
running install
/Users/assignment2/venv/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_ext
creating build
creating build/temp.macosx-10.9-x86_64-3.8
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I../ -I../pybind11/include -I/Users/assignment2/venv/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c bindings.cc -o build/temp.macosx-10.9-x86_64-3.8/bindings.o -std=c++11
bindings.cc:1:10: fatal error: 'pybind11/pybind11.h' file not found
#include "pybind11/pybind11.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/assignment2/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/setup.py'"'"'; __file__='"'"'/private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-install-n2ikxhrd/tinyobjloader_e31de4c63a314c94a6b7729348292448/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/mc/1f9c4_mn1p93n0ynhkb96ctc0000gn/T/pip-record-_ftffefa/install-record.txt --single-version-externally-managed --compile --install-headers /Users/assignment2/venv/include/site/python3.8/tinyobjloader Check the logs for full command output.