본문 바로가기
협업툴,가상환경 정리/venv_정리

python3.8 , 3.9 venv + rospkg 환경설정 및 설치 in ubuntu + venv 위치경로 바꾸려면

by 알 수 없는 사용자 2022. 5. 17.

참고

https://docs.python.org/ko/3/tutorial/venv.html

 

12. 가상 환경 및 패키지 — Python 3.10.4 문서

12.3. pip로 패키지 관리하기 You can install, upgrade, and remove packages using a program called pip. By default pip will install packages from the Python Package Index, <https://pypi.org>. You can browse the Python Package Index by going to it in

docs.python.org

 

https://dojang.io/mod/page/view.php?id=2470 

 


venv lib 다운

sudo apt install python3.8-venv

 

가상환경생성 ( py3_venv_2 는 이름 )

python3.8 -m venv py38_venv

python3.8 -m venv .venv38

 

가상환경활성화

source py38_venv/bin/activate

 

rospkg 설치

pip install rospkg     <- 이거 안되면 pip3.8 install rospkg 또는 pip3 install rospkg

 

하면 끝


venv lib 다운

sudo apt install python3.9-venv

 

python3.9 -m venv py39_venv

 

source ./py39_venv/bin/activate

 

pip --version

 

 

추천 pip 

 ################################################################################################

pip install --upgrade pip && pip install pyyaml && pip install --upgrade setuptools wheel && pip install --upgrade setuptools && pip install rospkg && pip install gmqtt && pip install uvloop && pip install numpy && pip install python-vlc && pip install psutil && pip install requests && pip install squaternion && pip install attrs && pip install pymysql-pool && pip install aiopubsub && pip install enforce_typing && pip install websockets && pip install flask && pip install diskcache && pip install prompt_toolkit

################################################################################################

 

# pip install attrs && pip install pymysql-pool 이 두개는 잘보고 설치해야함 버전이나 이름명이 다다름 #


 

ls python3-venv/bin/ 하면 가상환경에 깔려있는 python lib들 볼 수 있다.

 

이거로 환경path 확인 하기 가능

 

rospkg lib 확인하는법 1

2

 


 

ps>팁 / 로컬환경 lib 같이 깔기

 


가상환경 activate 상태에서 pip로 lib 다운시

~/ros1_ws/py3.8_venv_1/lib/python3.8/site-packages

== 가상환경dir/lib/python3.8/site-packages 안에 다 저장됨.

 

가상환경dir/bin 에는 사용할 python 버전 있음

 

 



venv 위치경로 바꾸려면

.venv 있는 경로를 바꾸려면 ~

https://dev.to/geekypandey/copy-venv-from-one-folder-to-another-and-still-be-able-to-use-it-3m49

 

Copy venv from one folder to another and still be able to use it?

If you have ever copied the python virtual environment folder from one location to another and faced...

dev.to

 

zz 근데 안됨 에러남

 밑에 에러 ->

sed: couldn't edit __pycache__: not a regular file

 

 

'협업툴,가상환경 정리 > venv_정리' 카테고리의 다른 글

python2.7 venv in ubuntu  (0) 2022.05.17

댓글