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

[Help Request] Unable to complete installation according to the document. #2090

Closed
l1xiao opened this issue Oct 2, 2023 · 2 comments · Fixed by #2093
Closed

[Help Request] Unable to complete installation according to the document. #2090

l1xiao opened this issue Oct 2, 2023 · 2 comments · Fixed by #2093
Assignees
Labels
help wanted Extra attention is needed

Comments

@l1xiao
Copy link

l1xiao commented Oct 2, 2023

High Level Description

I followed the doc to install SMARTS but failed. There are 2 problems:

  1. $ pip install -e .[camera_obs,sumo,test] should be $ pip install -e '.[camera_obs,sumo,test]'
  2. Fail to execute $ make sanity-test, error info:

(.venv) ➜ SMARTS git:(v1.4.0) make sanity-test
scl scenario build --clean scenarios/sumo/loop
Building: scenarios/sumo/loop
Error processing line 1 of /home/XX/SMARTS/.venv/lib/python3.8/site-packages/editable.smarts-1.4.0.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site.py", line 169, in addpackage
exec(line)
File "", line 1, in
File "/home/XX/SMARTS/.venv/lib/python3.8/site-packages/__editable___smarts_1_4_0_finder.py", line 2, in
from importlib.machinery import ModuleSpec, PathFinder
File "/usr/local/lib/python3.8/importlib/init.py", line 57, in
import types
File "/home/XX/SMARTS/smarts/sstudio/types/init.py", line 20, in
from smarts.sstudio.types.actor.social_agent_actor import *
ModuleNotFoundError: No module named 'smarts'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site.py", line 580, in
main()
File "/usr/local/lib/python3.8/site.py", line 563, in main
known_paths = venv(known_paths)
File "/usr/local/lib/python3.8/site.py", line 495, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/local/lib/python3.8/site.py", line 350, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/local/lib/python3.8/site.py", line 208, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/local/lib/python3.8/site.py", line 179, in addpackage
import traceback
File "/usr/local/lib/python3.8/traceback.py", line 5, in
import linecache
File "/usr/local/lib/python3.8/linecache.py", line 11, in
import tokenize
File "/usr/local/lib/python3.8/tokenize.py", line 32, in
import re
File "/usr/local/lib/python3.8/re.py", line 124, in
import enum
File "/usr/local/lib/python3.8/enum.py", line 2, in
from types import MappingProxyType, DynamicClassAttribute
File "/home/XX/SMARTS/smarts/sstudio/types/init.py", line 20, in
from smarts.sstudio.types.actor.social_agent_actor import *
ModuleNotFoundError: No module named 'smarts'
Command '['/home/XX/SMARTS/.venv/bin/python3.8', 'scenario_builder.py', '/home/XX/SMARTS/scenarios/sumo/loop/scenario.py', '42']' returned non-zero exit status 1.
Makefile:87: recipe for target 'build-sanity-scenarios' failed
make: *** [build-sanity-scenarios] Error 1

Version

1.4.0

Operating System

ubuntu 18.04

Problems

No response

@l1xiao l1xiao added the help wanted Extra attention is needed label Oct 2, 2023
@Gamenot
Copy link
Collaborator

Gamenot commented Oct 2, 2023

High Level Description

I followed the doc to install SMARTS but failed. There are 2 problems:

  1. $ pip install -e .[camera_obs,sumo,test] should be $ pip install -e '.[camera_obs,sumo,test]'

Yes, that can be updated, I assume you are using a different shell like zsh?

  1. Fail to execute $ make sanity-test, error info:

This seems a bit odd to me. Considering importlib is unable to resolve import smarts I wonder if the package installed correctly. My confusion here is that the entry-point smarts.sstudio.types is being imported as types as if it were an individual package.

  • Does the SMARTS package show up in pip freeze | grep smarts?
  • Does types somehow show up in pip freeze | grep smarts?
  • Does python -m smarts give /**/python: No module named smarts (the expected is /**/python: No module named smarts.__main__; ...
  • There might be an issue related here with the __editable__**finder.py depending on setuptools version Editable installs are broken after __editable__ and __path_hook__ changes pypa/setuptools#3548 reinstalling with --config-settings editable_mode=strict might work.

@Gamenot Gamenot self-assigned this Oct 2, 2023
@l1xiao
Copy link
Author

l1xiao commented Oct 3, 2023

Thanks for your reply!

I assume you are using a different shell like zsh?

Yes, I use zsh indeed.

--config-settings editable_mode=strict

It works! I can run the example correctly now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants