모도리는 공부중

[OpenX] scenariogeneration install 본문

내 지식 정리/날것 그 자체

[OpenX] scenariogeneration install

공부하는 모도리 2021. 8. 9. 10:16
728x90
반응형

시나리오 데이터 구조 분석을 위해 오픈시나리오 .xosc 파일을 찾다 찾다 안되겠어서 설치해서 직접 테스트해보려고 설치 시작. 일단 사수와의 공유를 위해(근데 회사꺼 아니고 내꺼로.. 해도 되겠지..?)

 

ㅇㅏ 몰랑..

 

가상환경부터 만들어야겠다는 생각에 기억이 가물하니 내 노트를 뒤져서 가상환경부터 만들어냈고,

이제 설치를 시작해볼까~하는데 바로 오류를 맞닥뜨렸다.

(base) PS D:\Project\OpenSCENARIO\openscenario> conda activate openScenarioGeneration 
(openScenarioGeneration) PS D:\Project\OpenSCENARIO\openscenario> pip install scenariogeneration
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scenariogeneration/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scenariogeneration/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/scenariogeneration/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLErWARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLErCould not fetch URL https://pypi.org/simple/scenariogeneration/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/scenariogeneration/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
ERROR: Could not find a version that satisfies the requirement scenariogeneration
ERROR: No matching distribution found for scenariogeneration
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.       
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL 
because the SSL module is not available.")) - skipping

...what?

 

이제 막 가상환경 만들었는데.. pip로 설치된 것들부터 확인해봐야겠다. 하고 pip list를 입력했더니 뭐가 왕창 뜨고,

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL 
because the SSL module is not available.")) - skipping

이 녀석을 다시 한 번 마주했다.

 

그래서 구글링 시작. 나의 검색어는 ssl module이었지만 아래 연관검색어로 나와 같은 현상을 겪는 사람들이 친히 길게 늘어놓아준 문장은 바로, ssl module in Python is not available.

 

 

OpenSSL을 설치하는게 답이라는 글을 보고.. 안 그래도 ssl 작업해야돼서 공부하고 있었는데 연관이 있는지 없는지 모르겠지만 이것부터 해야되는게 맞는 것 같다!! 싶어 이 글을 보며 설치...

 

OpenSSL 윈도우에서 설치하는 방법

1. OpenSSL이란? OpenSSL은 SSL과 같은 네트워크 프로토콜을 오픈소스로 구현해놓은 보안 라이브러리입니다. HTTPS가 SSL/TLS을 사용하는 대표적인 사례입니다. HTTPS는 SSL/TLS인증서를 이용해서 데이터를

iteastory.com

를 하려다가 사수가 와서 보니 이건 답이 될 수 없다고 하기에, 그럼 뭐가 문제일까 생각하며 설치 요구 조건을 다시 뜯어보았다.

Prerequisites

Been tested with Python >3.6.9. With Python versions <3.7 the order of certain xml-elements might not be the same between generations.


필수 구성 요소

Python > 3.6.9로 테스트했습니다. Python 버전 <3.7에서는 세대 간 특정 xml 요소의 순서가 동일하지 않을 수 있습니다.

 

문제는 이거였다. 나는 학원 때를 생각하며 python을 가상환경 만들 때 기본 조건으로 설정하지 않고 그냥 바로

conda create -n [가상환경명]

으로 만들었는데, 이게 학원에서 먹혔던 이유는 anaconda gui 프로그램을 이용하여 그냥 가상환경만 만들었다고 생각했지만 파이썬버전까지 설정하고 다 만들어진 것이었다.

이처럼 단순히 위에 입력한 코드처럼 가상환경만 만들면 아무리 python --version 확인을 해도 이게 무슨 버전인지 뜨지 않는다. 그저 Python이라고 내뱉을 뿐.

 

그래서 필수 구성 요소로 말하고 있는 버전을 생각하며 가상환경을 재설정해주었다.

conda create -n [name] python=3.8

진짜 답을 찾아서 설정했으니 이제 잘 되겠지?

더보기

실은.. 필수 구성 요소 글을 잘못 읽어서 3.6.9로 가상환경을 먼저 만들었었다. 만들고 나서 글을 잘못 읽었다는 것을 깨닫고 scenariogeneration을 설치하지 않고 바로 3.8 버전으로 가상환경을 재구축하였기에..

두 개의 가상환경을 접속해서 확인해보면 pip 리스트가 조금 다르다.

(base) PS C:\Users\modory> conda activate scenario

(scenario) PS C:\Users\modory> pip list
Package      Version
------------ -------------------
certifi      2021.5.30
pip          21.2.2
setuptools   52.0.0.post20210125
wheel        0.36.2
wincertstore 0.2

(scenario) PS C:\Users\modory> python --version
Python 3.6.9 :: Anaconda, Inc.

(scenario) PS C:\Users\modory> conda deactivate

(base) PS C:\Users\modory> conda activate scenario38

(scenario38) PS C:\Users\modory> pip list
Package            Version
------------------ -------------------
certifi            2021.5.30
numpy              1.21.1
pip                21.2.2
scenariogeneration 0.5.0
scipy              1.7.1
setuptools         52.0.0.post20210125
wheel              0.36.2
wincertstore       0.2

 

혹시나 나처럼 가상환경을 잘못 만들었다면 당황하지 말고, 지우면 된다.

그냥 지우면 가상환경 설정시 자동으로 같이 설치된 패키지들이 아우성치며 에러를 뱉을 것이므로, 패키지를 모두 포함하여 지우겠다는 명령어를 추가하여 지워주도록 한다.

conda remove -n [지울 가상환경명] --all

위 코드에서 --all을 추가해주면 깔끔히 가상환경이 지워진 것을 확인할 수 있을 것이다.

잘 지워졌는지 확인하는 방법은?

conda env list

이제 환경을 갖췄으므로

pip install scenariogeneration

을 입력해 설치해주고 pip list와 python --version을 확인하면

(scenario38) PS C:\Users\modory> pip list
Package            Version
------------------ -------------------
certifi            2021.5.30
numpy              1.21.1
pip                21.2.2
scenariogeneration 0.5.0
scipy              1.7.1
setuptools         52.0.0.post20210125
wheel              0.36.2
wincertstore       0.2

(scenario38) PS C:\Users\modory> python --version
Python 3.8.11

설정 완료~~!

 

이제 사용하기에 앞서 사용자 설명서(user guide)를 읽고 오자. 물론 영어로 되어있다. 번역기를 돌려도 좋고, 크롬이나 웨일의 확장프로그램을 이용하여 페이지 번역 후 읽어도 좋다!

 

이런 내용이 어디에 나와있냐고? 당연히 pip 사이트에 나와있지. github에도 나와있으니 참고 바란다.

아래에는 그 링크(사진을 클릭하면 사이트로 연결된다.)

 

 

자율주행차 시뮬레이터를 위한 시나리오 생성 파이프라인

 

A scenario generation pipeline for autonomous vehicle simulators - Human-centric Computing and Information Sciences

To develop a realistic simulator for autonomous vehicle testing, the simulation of various scenarios that may occur near vehicles in the real world is necessary. In this paper, we propose a new scenario generation pipeline focused on generating scenarios i

hcis-journal.springeropen.com

 

728x90
반응형
Comments