How to get a completely clean python environment with miniconda? - python

I have tried:
conda create --name Leaf python==3.6.5
And if I do conda list
I can find:
# packages in environment at /home/roychang/miniconda3/envs/Leaf:
#
# Name Version Build Channel
ca-certificates 2018.03.07 0
certifi 2018.4.16 py36_0
libedit 3.1.20170329 h6b74fdf_2
libffi 3.2.1 hd88cf55_4
libgcc-ng 7.2.0 hdf63c60_3
libstdcxx-ng 7.2.0 hdf63c60_3
ncurses 6.1 hf484d3e_0
openssl 1.0.2o h14c3975_1
pip 10.0.1 py36_0
python 3.6.5 hc3d631a_2
readline 7.0 ha6073c6_4
setuptools 40.0.0 py36_0
sqlite 3.24.0 h84994c4_0
tk 8.6.7 hc745277_3
wheel 0.31.1 py36_0
xz 5.2.4 h14c3975_4
zlib 1.2.11 ha838bed_2
But if I try to run some script which use some package didn't in this list (like kivy).
I think it shouldn't work, but it did!
So does MiniConda auto fetch the package from the origin python root?
How could I get a completely clean python environment with MiniConda?
UPDATE:
Seems that I didn't explain well, I had activated that environment and what I got after doing conda list was the result showing above.
I could run this script when I activated the environment, although I didn't install kivy under this environment. I only installed kivy to the origin python before I installed MiniConda.
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.widget import Widget
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.uix.spinner import Spinner
from kivy.uix.label import Label
from kivy.uix.image import Image
from kivy.uix.textinput import TextInput
from kivy.graphics import Color, Ellipse, Line, Rectangle
from kivy.lang import Builder
And what else I found is if I try which python, it showed:
(Leaf) roychang#ThinkPad-T480:~$ which python
/home/roychang/miniconda3/bin/python
After I deactivated the environment and did which python again I got the same result.
Is this expected? I think it should use different python in different environment.
conda list in default environment (I found Kivy isn't here):
# Name Version Build Channel
asn1crypto 0.24.0 py36_0
ca-certificates 2018.03.07 0
certifi 2018.4.16 py36_0
cffi 1.11.5 py36h9745a5d_0
chardet 3.0.4 py36h0f667ec_1
conda 4.5.4 py36_0
conda-env 2.6.0 h36134e3_1
cryptography 2.2.2 py36h14c3975_0
idna 2.6 py36h82fb2a8_1
libedit 3.1.20170329 h6b74fdf_2
libffi 3.2.1 hd88cf55_4
libgcc-ng 7.2.0 hdf63c60_3
libstdcxx-ng 7.2.0 hdf63c60_3
ncurses 6.1 hf484d3e_0
openssl 1.0.2o h20670df_0
pip 10.0.1 py36_0
pycosat 0.6.3 py36h0a5515d_0
pycparser 2.18 py36hf9f622e_1
pyopenssl 18.0.0 py36_0
pysocks 1.6.8 py36_0
python 3.6.5 hc3d631a_2
readline 7.0 ha6073c6_4
requests 2.18.4 py36he2e5f8d_1
ruamel_yaml 0.15.37 py36h14c3975_2
setuptools 39.2.0 py36_0
six 1.11.0 py36h372c433_1
sqlite 3.23.1 he433501_0
tk 8.6.7 hc745277_3
urllib3 1.22 py36hbe7ace6_0
wheel 0.31.1 py36_0
xz 5.2.4 h14c3975_4
yaml 0.1.7 had09818_2
zlib 1.2.11 ha838bed_2
pip list in default environment (kivy is found here):
Package Version
---------------------- ---------
asn1crypto 0.24.0
bcrypt 3.1.4
bitarray 0.8.3
boto 2.49.0
boto3 1.7.74
botocore 1.10.74
certifi 2018.4.16
cffi 1.11.5
chardet 3.0.4
click 6.7
coloredlogs 10.0
conda 4.5.4
cryptography 2.3
Cython 0.28.2
docutils 0.14
ffmpeg-python 0.1.15
ffmpy 0.2.2
future 0.16.0
humanfriendly 4.16.1
idna 2.7
jmespath 0.9.3
Kivy 1.10.1
Kivy-Garden 0.1.4
mysql-connector-python 8.0.11
numpy 1.15.0
paramiko 2.4.1
Pillow 5.2.0
pip 10.0.1
protobuf 3.6.0
pyasn1 0.4.4
pycosat 0.6.3
pycparser 2.18
Pygments 2.2.0
pymongo 3.7.1
PyNaCl 1.2.1
pyOpenSSL 18.0.0
pyperclip 1.6.2
PySocks 1.6.8
python-dateutil 2.7.3
pytz 2018.5
pyzmq 17.1.0
requests 2.19.1
ruamel-yaml 0.15.37
s3transfer 0.1.13
scipy 1.1.0
setuptools 40.0.0
six 1.11.0
torchfile 0.1.0
tornado 5.1
urllib3 1.23
visdom 0.1.8.4
websocket-client 0.48.0
wheel 0.31.1
zmq 0.0.0
pip list in Leaf (kivy is found here too):
Package Version
---------------------- ---------
asn1crypto 0.24.0
bcrypt 3.1.4
bitarray 0.8.3
boto 2.49.0
boto3 1.7.74
botocore 1.10.74
certifi 2018.4.16
cffi 1.11.5
chardet 3.0.4
click 6.7
coloredlogs 10.0
cryptography 2.3
Cython 0.28.2
docutils 0.14
ffmpeg-python 0.1.15
ffmpy 0.2.2
future 0.16.0
humanfriendly 4.16.1
idna 2.7
jmespath 0.9.3
Kivy 1.10.1
Kivy-Garden 0.1.4
mysql-connector-python 8.0.11
numpy 1.15.0
paramiko 2.4.1
Pillow 5.2.0
pip 10.0.1
protobuf 3.6.0
pyasn1 0.4.4
pycparser 2.18
Pygments 2.2.0
pymongo 3.7.1
PyNaCl 1.2.1
pyOpenSSL 18.0.0
pyperclip 1.6.2
python-dateutil 2.7.3
pytz 2018.5
pyzmq 17.1.0
requests 2.19.1
s3transfer 0.1.13
scipy 1.1.0
setuptools 40.0.0
six 1.11.0
torchfile 0.1.0
tornado 5.1
umbopython 0.3
urllib3 1.23
visdom 0.1.8.4
websocket-client 0.48.0
wheel 0.31.1
zmq 0.0.0
And:
roychang#ThinkPad-T480:~$ which pip
/home/roychang/miniconda3/bin/pip
roychang#ThinkPad-T480:~$ act Leaf
(Leaf) roychang#ThinkPad-T480:~$ which pip
/home/roychang/miniconda3/envs/Leaf/bin/pip
LAST UPDATE (PROBABLY):
Still not solved.
But don't know why python is separated now.
Tried to uninstall Kivy under Leaf, then Kivy disappeared from both pip list.
I then re-install it under Leaf, and only Leaf got Kivy now.

You have created a conda environment yes, but you need to activate. Use
jalazbe#DESKTOP:~$ conda activate Leaf
You may only use it if the name of the environment is on the left side of your prompt and
(Leaf) jalazbe#DESKTOP:~$
If you now execute
(Leaf) jalazbe#DESKTOP:~$ conda list
Then you will see the minimal libraries that conda need to run python.
To install new libraries use
(Leaf) jalazbe#DESKTOP:~$ conda install name-of-library
# example
(Leaf) jalazbe#DESKTOP:~$ conda install pandas
.
I recommend you read some more info at conda

Related

Pyodbc pip install issue --

I am trying to pip install dbt-sqlserver and am having issues downloading or building the wheel for pyodbc. I am using python version 3.11 and on a virtual machine. I have not had this issue previously on my local machine.
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
It then details that this is a legacy install failure. I previously downloaded the Microsoft Visual Studio build tools based off a prior error and these are the packages selected.
I am expecting to hopefully download dbt-sqlserver. I have tried multiple different things from stackoverflow to no avail.
Here is my current pip list covering everything within my virtual environment on my VM.
Package Version
------------------------ -----------
agate 1.7.0
aiosqlite 0.18.0
alembic 1.9.2
anyio 3.6.2
apprise 1.2.1
asgi-lifespan 2.0.0
asyncpg 0.27.0
attrs 22.2.0
Babel 2.11.0
betterproto 1.2.5
cachetools 5.3.0
certifi 2022.12.7
cffi 1.15.1
charset-normalizer 3.0.1
click 8.1.3
cloudpickle 2.2.1
colorama 0.4.6
coolname 2.2.0
croniter 1.3.8
cryptography 39.0.0
dateparser 1.1.6
dbt-core 1.4.1
dbt-extractor 0.4.1
docker 6.0.1
fastapi 0.89.1
fsspec 2023.1.0
future 0.18.3
google-auth 2.16.0
graphql-core 3.2.3
greenlet 2.0.2
griffe 0.25.4
grpclib 0.4.3
h11 0.14.0
h2 4.1.0
hologram 0.0.15
hpack 4.0.0
httpcore 0.16.3
httpx 0.23.3
hyperframe 6.0.1
idna 3.4
isodate 0.6.1
Jinja2 3.1.2
jsonpatch 1.32
jsonpointer 2.3
jsonschema 3.2.0
kubernetes 25.3.0
leather 0.3.4
Logbook 1.5.3
Mako 1.2.4
Markdown 3.4.1
markdown-it-py 2.1.0
MarkupSafe 2.1.2
mashumaro 3.3.1
mdurl 0.1.2
minimal-snowplow-tracker 0.0.2
msgpack 1.0.4
multidict 6.0.4
networkx 2.8.8
oauthlib 3.2.2
orjson 3.8.5
packaging 21.3
parsedatetime 2.4
pathspec 0.10.3
pendulum 2.1.2
pip 23.0
prefect 2.7.10
prefect-dbt 0.2.7
prefect-shell 0.1.3
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.21
pydantic 1.10.4
Pygments 2.14.0
pyodbc 4.0.35
pyparsing 3.0.9
pyrsistent 0.19.3
python-dateutil 2.8.2
python-slugify 8.0.0
pytimeparse 1.1.8
pytz 2022.7.1
pytz-deprecation-shim 0.1.0.post0
pytzdata 2020.1
pywin32 305
PyYAML 6.0
readchar 4.0.3
regex 2022.10.31
requests 2.28.2
requests-oauthlib 1.3.1
rfc3986 1.5.0
rich 13.3.1
rsa 4.9
setuptools 67.1.0
sgqlc 16.1
six 1.16.0
sniffio 1.3.0
SQLAlchemy 1.4.46
sqlparse 0.4.3
starlette 0.22.0
stringcase 1.2.0
text-unidecode 1.3
toml 0.10.2
typer 0.7.0
typing_extensions 4.4.0
tzdata 2022.7
tzlocal 4.2
urllib3 1.26.14
uvicorn 0.20.0
websocket-client 1.5.0
Werkzeug 2.2.2
wheel 0.38.4

Why is pip not letting me install torch==1.9.1+cu111 in a new conda env when I have another conda env that has exactly that version?

When I run the pip install in the new conda env:
(base) brando9~ $ pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.9.1+cu111 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2)
ERROR: No matching distribution found for torch==1.9.1+cu111
the other env with that pytorch version:
(metalearning3.9) [pzy2#vision-submit ~]$ pip list
Package Version Location
---------------------------------- -------------------- ------------------
absl-py 1.0.0
aiohttp 3.8.3
aiosignal 1.3.1
alabaster 0.7.12
anaconda-client 1.9.0
anaconda-project 0.10.1
antlr4-python3-runtime 4.8
anyio 2.2.0
appdirs 1.4.4
argcomplete 2.0.0
argh 0.26.2
argon2-cffi 20.1.0
arrow 0.13.1
asn1crypto 1.4.0
astroid 2.6.6
astropy 4.3.1
asttokens 2.0.7
astunparse 1.6.3
async-generator 1.10
async-timeout 4.0.2
atomicwrites 1.4.0
attrs 21.2.0
autopep8 1.5.7
Babel 2.9.1
backcall 0.2.0
backports.shutil-get-terminal-size 1.0.0
beautifulsoup4 4.10.0
binaryornot 0.4.4
bitarray 2.3.0
bkcharts 0.2
black 19.10b0
bleach 4.0.0
bokeh 2.4.1
boto 2.49.0
Bottleneck 1.3.2
brotlipy 0.7.0
cached-property 1.5.2
cachetools 5.0.0
certifi 2021.10.8
cffi 1.14.6
chardet 4.0.0
charset-normalizer 2.0.4
cherry-rl 0.1.4
click 8.0.3
cloudpickle 2.0.0
clyent 1.2.2
colorama 0.4.4
conda 4.12.0
conda-content-trust 0+unknown
conda-pack 0.6.0
conda-package-handling 1.8.0
conda-token 0.3.0
configparser 5.3.0
contextlib2 0.6.0.post1
cookiecutter 1.7.2
crc32c 2.3
crcmod 1.7
cryptography 3.4.8
cycler 0.10.0
Cython 0.29.24
cytoolz 0.11.0
daal4py 2021.3.0
dask 2021.10.0
debugpy 1.4.1
decorator 5.1.0
defusedxml 0.7.1
diff-match-patch 20200713
dill 0.3.4
distributed 2021.10.0
docker-pycreds 0.4.0
docutils 0.17.1
entrypoints 0.3
et-xmlfile 1.1.0
executing 0.9.1
fairseq 0.12.2 /home/pzy2/fairseq
fastcache 1.1.0
fastcluster 1.2.6
fasteners 0.17.3
filelock 3.3.1
flake8 3.9.2
Flask 1.1.2
flatbuffers 2.0.7
fonttools 4.25.0
frozenlist 1.3.0
fsspec 2021.8.1
gast 0.4.0
gcs-oauth2-boto-plugin 3.0
gevent 21.8.0
gitdb 4.0.9
GitPython 3.1.27
glob2 0.7
gmpy2 2.0.8
google-apitools 0.5.32
google-auth 2.6.3
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
google-reauth 0.1.1
gql 0.2.0
graphql-core 1.1
greenlet 1.1.1
grpcio 1.44.0
gsutil 5.9
gym 0.22.0
gym-notices 0.0.6
h5py 3.3.0
HeapDict 1.0.1
higher 0.2.1
html5lib 1.1
httplib2 0.20.4
huggingface-hub 0.5.1
hydra-core 1.0.7
idna 3.2
imagecodecs 2021.8.26
imageio 2.9.0
imagesize 1.2.0
importlib-metadata 4.12.0
inflection 0.5.1
iniconfig 1.1.1
intervaltree 3.1.0
ipykernel 6.4.1
ipython 7.29.0
ipython-genutils 0.2.0
ipywidgets 7.6.5
isort 5.9.3
itsdangerous 2.0.1
jdcal 1.4.1
jedi 0.18.0
jeepney 0.7.1
Jinja2 2.11.3
jinja2-time 0.2.0
joblib 1.1.0
json5 0.9.6
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.12
jupyter-console 6.4.0
jupyter-core 4.8.1
jupyter-server 1.4.1
jupyterlab 3.2.1
jupyterlab-pygments 0.1.2
jupyterlab-server 2.8.2
jupyterlab-widgets 1.0.0
keras 2.10.0
Keras-Preprocessing 1.1.2
keyring 23.1.0
kiwisolver 1.3.1
lark-parser 0.12.0
lazy-object-proxy 1.6.0
learn2learn 0.1.7
libarchive-c 2.9
libclang 14.0.6
littleutils 0.2.2
llvmlite 0.37.0
locket 0.2.1
loguru 0.6.0
lxml 4.6.3
Markdown 3.3.6
MarkupSafe 1.1.1
matplotlib 3.4.3
matplotlib-inline 0.1.2
mccabe 0.6.1
mistune 0.8.4
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mock 4.0.3
monotonic 1.6
more-itertools 8.10.0
mpmath 1.2.1
msgpack 1.0.2
multidict 6.0.2
multipledispatch 0.6.0
munkres 1.1.4
mypy-extensions 0.4.3
nbclassic 0.2.6
nbclient 0.5.3
nbconvert 6.1.0
nbformat 5.1.3
nest-asyncio 1.5.1
networkx 2.6.3
nltk 3.6.5
nose 1.3.7
notebook 6.4.5
numba 0.54.1
numexpr 2.7.3
numpy 1.20.3
numpydoc 1.1.0
nvidia-ml-py3 7.352.0
nvidia-smi 0.1.3
oauth2client 4.1.3
oauthlib 3.2.0
olefile 0.46
omegaconf 2.0.6
opencv-python 4.6.0.66
openpyxl 3.0.9
opt-einsum 3.3.0
ordered-set 4.1.0
packaging 21.0
pandas 1.3.4
pandocfilters 1.4.3
parso 0.8.2
partd 1.2.0
path 16.0.0
pathlib2 2.3.6
pathspec 0.7.0
pathtools 0.1.2
patsy 0.5.2
pep8 1.7.1
pexpect 4.8.0
pickleshare 0.7.5
Pillow 8.4.0
pip 22.2.2
pkginfo 1.7.1
plotly 5.7.0
pluggy 0.13.1
ply 3.11
portalocker 2.5.1
poyo 0.5.0
progressbar2 4.0.0
prometheus-client 0.11.0
promise 2.3
prompt-toolkit 3.0.20
protobuf 3.19.6
psutil 5.8.0
ptyprocess 0.7.0
py 1.10.0
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycodestyle 2.7.0
pycosat 0.6.3
pycparser 2.20
pycurl 7.44.1
pydocstyle 6.1.1
pyerfa 2.0.0
pyflakes 2.3.1
Pygments 2.10.0
pylint 2.9.6
pyls-spyder 0.4.0
pyodbc 4.0.0-unsupported
pyOpenSSL 21.0.0
pyparsing 3.0.4
pyrsistent 0.18.0
PySocks 1.7.1
pytest 6.2.4
python-dateutil 2.8.2
python-lsp-black 1.0.0
python-lsp-jsonrpc 1.0.0
python-lsp-server 1.2.4
python-slugify 5.0.2
python-utils 3.1.0
pytz 2021.3
pyu2f 0.1.5
PyWavelets 1.1.1
pyxdg 0.27
PyYAML 6.0
pyzmq 22.2.1
QDarkStyle 3.0.2
qpth 0.0.15
qstylizer 0.1.10
QtAwesome 1.0.2
qtconsole 5.1.1
QtPy 1.10.0
regex 2021.8.3
requests 2.26.0
requests-oauthlib 1.3.1
retry-decorator 1.1.1
rope 0.19.0
rsa 4.7.2
Rtree 0.9.7
ruamel-yaml-conda 0.15.100
sacrebleu 2.2.0
sacremoses 0.0.49
scikit-image 0.18.3
scikit-learn 0.24.2
scikit-learn-intelex 2021.20210714.170444
scipy 1.7.1
seaborn 0.11.2
SecretStorage 3.3.1
Send2Trash 1.8.0
sentry-sdk 1.5.9
setproctitle 1.2.2
setuptools 58.0.4
shortuuid 1.0.8
simplegeneric 0.8.1
singledispatch 3.7.0
sip 4.19.13
six 1.16.0
sklearn 0.0
smmap 5.0.0
sniffio 1.2.0
snowballstemmer 2.1.0
sorcery 0.2.2
sortedcollections 2.1.0
sortedcontainers 2.4.0
soupsieve 2.2.1
Sphinx 4.2.0
sphinxcontrib-applehelp 1.0.2
sphinxcontrib-devhelp 1.0.2
sphinxcontrib-htmlhelp 2.0.0
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.3
sphinxcontrib-serializinghtml 1.1.5
sphinxcontrib-websupport 1.2.4
spyder 5.1.5
spyder-kernels 2.1.3
SQLAlchemy 1.4.22
statsmodels 0.12.2
subprocess32 3.5.4
sympy 1.9
tables 3.6.1
TBB 0.2
tblib 1.7.0
tensorboard 2.10.1
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow-estimator 2.10.0
tensorflow-gpu 2.10.1
tensorflow-io-gcs-filesystem 0.27.0
termcolor 2.0.1
terminado 0.9.4
testpath 0.5.0
text-unidecode 1.3
textdistance 4.2.1
tfrecord 1.14.1
threadpoolctl 2.2.0
three-merge 0.1.1
tifffile 2021.7.2
timm 0.6.11
tinycss 0.4
tokenizers 0.11.6
toml 0.10.2
toolz 0.11.1
torch 1.9.1+cu111
torchaudio 0.9.1
torchmeta 1.8.0
torchtext 0.10.1
torchvision 0.10.1+cu111
tornado 6.1
tqdm 4.62.3
traitlets 5.1.0
transformers 4.18.0
typed-ast 1.4.3
typing-extensions 3.10.0.2
ujson 4.0.2
ultimate-anatome 0.1.1
ultimate-aws-cv-task2vec 0.0.1
unicodecsv 0.14.1
Unidecode 1.2.0
urllib3 1.26.7
wandb 0.13.5
watchdog 2.1.3
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 2.0.2
wheel 0.37.0
whichcraft 0.6.1
widgetsnbextension 3.5.1
wrapt 1.12.1
wurlitzer 2.1.1
xlrd 2.0.1
XlsxWriter 3.0.1
xlwt 1.3.0
yapf 0.31.0
yarl 1.7.2
zict 2.0.0
zipp 3.6.0
zope.event 4.5.0
zope.interface 5.4.0
WARNING: You are using pip version 22.2.2; however, version 22.3.1 is available.
You should consider upgrading via the '/home/pzy2/miniconda3/envs/metalearning3.9/bin/python -m pip install --upgrade pip' command.
(metalearning3.9) [pzy2#vision-submit ~]$
I asked a related question because I can't install pytorch with cuda with conda, see details here: why does conda install the pytorch CPU version despite me putting explicitly to download the cuda toolkit version?
I think this works:
# -- Install PyTorch sometimes requires more careful versioning due to cuda, ref: official install instruction https://pytorch.org/get-started/previous-versions/
# you need python 3.9 for torch version 1.9.1 to work, due to torchmeta==1.8.0 requirement
if ! python -V 2>&1 | grep -q 'Python 3\.9'; then
echo "Error: Python 3.9 is required!"
exit 1
fi
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
From looking at the link you've provided, I can see
cu111/torch-1.9.1%2Bcu111-cp36-cp36m-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp36-cp36m-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp37-cp37m-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp37-cp37m-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp38-cp38-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp38-cp38-win_amd64.whl
cu111/torch-1.9.1%2Bcu111-cp39-cp39-linux_x86_64.whl
cu111/torch-1.9.1%2Bcu111-cp39-cp39-win_amd64.whl
cp39 means Python version 3.9. Notice there is no support for 3.10 or 3.11. In your new environment, you probably are running a newer version of Python, whereas in the other environment you have Python 3.6, 3.7, 3.8, or 3.9
To install pytorch 1.9.1cu11 you need python 3.9 to be avaiable. Added that to my bash install.sh
# - create conda env
conda create -n metalearning_gpu python=3.9
conda activate metalearning_gpu
## conda remove --name metalearning_gpu --all
# - make sure pip is up to date
which python
pip install --upgrade pip
pip3 install --upgrade pip
which pip
which pip3
# -- Install PyTorch sometimes requires more careful versioning due to cuda, ref: official install instruction https://pytorch.org/get-started/previous-versions/
# you need python 3.9 for torch version 1.9.1 to work, due to torchmeta==1.8.0 requirement
if ! python -V 2>&1 | grep -q 'Python 3\.9'; then
echo "Error: Python 3.9 is required!"
exit 1
fi
pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html

How to find installed packaged through the command line and use them with Pycharm [duplicate]

This question already has answers here:
PyCharm doesn't recognize installed module
(23 answers)
How to cache downloaded PIP packages [duplicate]
(3 answers)
Closed 1 year ago.
I am starting to learn python, and I've been following courses using either command prompt or PyCharm.
I've been downloading packages through the command line prompt. Where can I find the installation directory and put it somewhere in PyCharm so that I don't have to download it twice?
To give an example, I just downloaded to matplotlib library using pip on the command line prompt as pip install maptlotlib. It got downloaded. When I then go to PyCharm - Setting - Python Environement, the maptlotlib package does not show up. How may I make it appear?
You need to choose this Python interpreter from PyCharm:
Settings > Project > Python interpreter.
It will show you every installed package.
use pip list you can get all installed package
bibo#esi09:~$ pip list
Package Version
---------------------- --------------------
attrs 19.3.0
Automat 0.8.0
blinker 1.4
certifi 2019.11.28
chardet 3.0.4
Click 7.0
cloud-init 21.1
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
constantly 15.1.0
cryptography 2.8
dbus-python 1.2.16
distro 1.4.0
distro-info 0.23ubuntu1
entrypoints 0.3
httplib2 0.14.0
hyperlink 19.0.0
idna 2.8
importlib-metadata 1.5.0
incremental 16.10.1
Jinja2 2.10.1
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
keyring 18.0.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
MarkupSafe 1.1.0
meson 0.53.2
more-itertools 4.2.0
netifaces 0.10.4
oauthlib 3.1.0
pexpect 4.6.0
pip 20.3.3
pyasn1 0.4.2
pyasn1-modules 0.2.1
Pygments 2.3.1
PyGObject 3.36.0
PyHamcrest 1.9.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.4
python-debian 0.1.36ubuntu1
PyYAML 5.3.1
requests 2.22.0
requests-unixsocket 0.2.0
SecretStorage 2.3.1
service-identity 18.1.0
setuptools 45.2.0
simplejson 3.16.0
simplelzo1x 1.1
six 1.14.0
sos 4.1
ssh-import-id 5.10
systemd-python 234
Twisted 18.9.0
ubuntu-advantage-tools 20.3
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
vtk 9.0.1
wadllib 1.3.3
wheel 0.34.2
zipp 1.0.0
zope.interface 4.7.1
WARNING: You are using pip version 20.3.3; however, version 21.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
bibo#esi09:~$

I cannot use opencv2 and received ImportError: libgl.so.1 cannot open shared object file no such file or directory

**env:**ubuntu16.04 anaconda3 python3.7.8 cuda10.0 gcc5.5
command:
conda activate myenv
python
import cv2
error:
Traceback (most recent call last):
File "", line 1, in
File "/home/.conda/envs/myenv/lib/python3.7/site-packages/cv2/__init__.py", line 5, in
from .cv2 import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
I tried:
RUN apt install libgl1-mesa-glx -y
RUN apt-get install 'ffmpeg'\
'libsm6'\
'libxext6' -y
but this is already installed and the latest version(libgl1-mesa-glx18.0.5-0ubuntu0~16.04.1).
then i tried:
sudo apt-get install --reinstall libgl1-mesa-glx
it doesn't work.
finally,I tried to remove the package:
sudo apt-get --purge remove libgl1-mesa-glx
another error occurred:
Reading package list... Done
Analyzing the dependency tree of the package
Reading status information... Done
Some packages cannot be installed. If you are using an unstable distribution, this may be
Because the system cannot reach the state you requested. There may be some software you need in this version
The packages have not been created yet or they have been moved out of the Incoming directory.
The following information may be helpful in solving the problem:
The following packages have unmet dependencies:
libqt5multimedia5-plugins: Dependency: libqgsttools-p1 (>= 5.5.1) but it will not be installed
E: Error, pkgProblemResolver::Resolve failed. This may be due to a software package being required to maintain the status quo.
Any help would be really helpful.Thanks in advance.
conda list:
# packages in environment at /home/lwy/.conda/envs/mmdet1:
#
# Name Version Build Channel
_libgcc_mutex 0.1 conda_forge https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
_openmp_mutex 4.5 1_gnu https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
addict 2.3.0 <pip>
albumentations 0.5.1 <pip>
appdirs 1.4.4 <pip>
asynctest 0.13.0 <pip>
attrs 20.2.0 <pip>
ca-certificates 2020.6.20 hecda079_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
certifi 2020.6.20 py37he5f6b98_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
chardet 3.0.4 <pip>
cityscapesScripts 2.1.7 <pip>
codecov 2.1.10 <pip>
coloredlogs 14.0 <pip>
coverage 5.3 <pip>
cycler 0.10.0 <pip>
Cython 0.29.21 <pip>
decorator 4.4.2 <pip>
flake8 3.8.4 <pip>
future 0.18.2 <pip>
humanfriendly 8.2 <pip>
idna 2.10 <pip>
imagecorruptions 1.1.0 <pip>
imageio 2.9.0 <pip>
imgaug 0.4.0 <pip>
importlib-metadata 2.0.0 <pip>
iniconfig 1.1.1 <pip>
isort 5.6.4 <pip>
kiwisolver 1.3.1 <pip>
kwarray 0.5.10 <pip>
ld_impl_linux-64 2.35 h769bd43_9 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libffi 3.2.1 1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
libgcc-ng 9.3.0 h5dbcf3e_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libgomp 9.3.0 h5dbcf3e_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libstdcxx-ng 9.3.0 h2ae2ef3_17 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
matplotlib 3.3.2 <pip>
mccabe 0.6.1 <pip>
mmcv 1.1.6 <pip>
mmdet 1.2.0+unknown <pip>
ncurses 6.2 he1b5a44_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
networkx 2.5 <pip>
numpy 1.19.4 <pip>
opencv-python 4.4.0.46 <pip>
openssl 1.1.1h h516909a_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
ordered-set 4.0.2 <pip>
packaging 20.4 <pip>
Pillow 6.2.2 <pip>
pip 20.2.4 py_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
pluggy 0.13.1 <pip>
py 1.9.0 <pip>
pycocotools 2.0 <pip>
pycodestyle 2.6.0 <pip>
pyflakes 2.2.0 <pip>
pyparsing 2.4.7 <pip>
pyquaternion 0.9.9 <pip>
pytest 6.1.2 <pip>
pytest-cov 2.10.1 <pip>
pytest-runner 5.2 <pip>
python 3.7.8 h6f2ec95_1_cpython https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python-dateutil 2.8.1 <pip>
python_abi 3.7 1_cp37m https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
PyWavelets 1.1.1 <pip>
PyYAML 5.3.1 <pip>
readline 8.0 he28a2e2_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
requests 2.24.0 <pip>
scikit-image 0.17.2 <pip>
scipy 1.5.3 <pip>
setuptools 49.6.0 py37he5f6b98_2 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
Shapely 1.7.1 <pip>
six 1.15.0 <pip>
sqlite 3.33.0 h4cf870e_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
tifffile 2020.10.1 <pip>
tk 8.6.10 hed695b0_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
toml 0.10.2 <pip>
torch 1.5.0+cu92 <pip>
torchvision 0.6.0+cu92 <pip>
tqdm 4.51.0 <pip>
typing 3.7.4.3 <pip>
ubelt 0.9.3 <pip>
urllib3 1.25.11 <pip>
wheel 0.35.1 pyh9f0ad1d_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
xdoctest 0.15.0 <pip>
xz 5.2.5 h516909a_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
yapf 0.30.0 <pip>
zipp 3.4.0 <pip>
zlib 1.2.11 0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
Usually these Pacakges are meant to be installed as System Packages and Not only Python packages. Therefore many times even after successfull installation of such packages like opencv, cmake, dlib they don't work.
The Best way is to Install them is using.
sudo apt-get install python3-opencv
This is the Preferred Method for the Successfull Installation of opencv on Ubuntu as per the Official Opencv Docs.
I have solved this problem!
Firstly, find the file:
find /usr -name libGL.so.1
I found /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.
Then, I created a soft link:
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so.1
Finally, I verified that it is valid:
# python
import cv2
I was able to solve the issue by
apt-get install libgl1

Unable to import python packages (already installed) in jupyter notebook RPi3

I'm using jupyter notebook in Raspberry Pi3. I have already installed pandas and other packages. My python3 IDLE can import all those packages but jupyter always shows an error saying
No module named pandas
Tried lots of things but none of them are working.
sudo pip3 install jupyter --upgrade
sudo pip3 install ipykernel --upgrade
pi#raspberrypi:~ $ pip3 list
Package Version
----------------------------- -----------
alabaster 0.7.12
appdirs 1.4.3
asn1crypto 0.24.0
astroid 2.1.0
asttokens 1.1.13
attrs 19.1.0
automationhat 0.1.0
Babel 2.7.0
backcall 0.1.0
beautifulsoup4 4.7.1
bleach 3.1.0
blinker 1.4
blinkt 0.1.2
bokeh 1.2.0
buttonshim 0.0.2
Cap1xxx 0.1.3
certifi 2018.8.24
chardet 3.0.4
Click 7.0
cloudpickle 1.2.1
colorama 0.3.7
colorzero 1.1
cookies 2.2.1
HeapDict 1.0.0
html5lib 1.0.1
idna 2.6
imagesize 1.1.0
ipykernel 5.1.1
ipyparallel 6.2.4
ipython 7.5.0
ipython-genutils 0.2.0
ipywidgets 7.4.2
isort 4.3.4
itsdangerous 0.24
jedi 0.13.2
Jinja2 2.10
jsonschema 3.0.1
jupyter 1.0.0
jupyter-client 5.2.4
jupyter-console 6.0.0
jupyter-core 4.5.0
keyring 17.1.1
keyrings.alt 3.1.1
kiwisolver 1.0.1
lazy-object-proxy 1.3.1
locket 0.2.0
logilab-common 1.4.2
lxml 4.3.2
packaging 19.0
pandas 0.24.2
import pandas as pd
ImportError: No modules named pandas

Categories