Now I am setting a new environment to work with a script that has the following packages:
import platform
import sys
import os
import re
import shutil
import numpy as np
import datetime
from osgeo import osr
from osgeo import gdal
from math import sin, cos, pi, tan
import time
import subprocess
import numpy.polynomial.polynomial as poly
from openpyxl import load_workbook
from pyproj import Proj, transform
import warnings
I am trying to install the packages using anaconda GUI, but I could not find the "osgeo" or "osr" or "numpy.polynomial.polynomial"
Can anyone help me or give me an alternative to quickly set the environment?
I selected all other packages like that
enter image description here
Related
I have a problem when importing some dependencies from stable baselines 3 library, I installed it with this command
pip install stable-baselines3[extra]
But When I import my dependencies
import gym
from stable_baselines3 import A2C
from stable_baselines3.common.vec_env import VecFrameStackFrame
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3.common.env_util import make_atari_env
import os
I face this error
ImportError: cannot import name 'VecFrameStackFrame' from 'stable_baselines3.common.vec_env' (C:\Users\User\anaconda3\envs\rl_learning\lib\site-packages\stable_baselines3\common\vec_env\__init__.py)
Any advice?
I knew that stable baselines new version has changed the name from
from stable_baselines3.common.vec_env import VecFrameStackFrame
To
from stable_baselines3.common.vec_env import vec_frame_stack
and it worked for me
```
!pip install mediapipe opencv-python
import mediapipe as mp
import cv2
import numpy as np
import uuid
import os
```
I used Jupiter Notebook to run this code
error:[1]: https://i.stack.imgur.com/sljDY.jpg
I have a problem with Google Colab, it crashes. When I try to import libraries, this system log appears:
WARNING:root:kernel 550fdef7-0cf5-47e7-86a7-8a6a019a6aaa restarted
KernelRestarter: restarting kernel (1/5), keep random ports
Kernel interrupted: 550fdef7-0cf5-47e7-86a7-8a6a019a6aaa
I looked for the answer in other posts and checked that the Ram was free (it is), but importing one library at a time I discovered that the problem is given by torch_geometric, what could I do? To install the libraries I use this code:
!pip install -q torch torchvision
!pip install torch-scatter torch-sparse torch-cluster torch- spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.10.0+cpu.html
!pip install import-ipynb
!pip install networkx
!pip install rdkit-pypi
!pip install deepchem
!pip install -q dgl
!pip install gdown -U --no-cache-dir
The libraries I'm trying to import are these:
# Usefull libreries to load and process the data
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.exceptions import ConvergenceWarning
from sklearn.metrics import accuracy_score
from sklearn.svm import LinearSVC
import import_ipynb
import warnings
import os
import os.path as osp
from tqdm import tqdm
# Usefull libresies to create and work on graph
import torch
import torch_geometric
import torch.nn.functional as F
from torch_geometric.loader import DataLoader
from torch_geometric import data
from torch_geometric.data import Data, Dataset, Batch
import torch_geometric.utils
from torch.nn import Linear, BatchNorm1d, ReLU, Sequential
import torch.nn.functional as F
from torch_geometric.nn import global_mean_pool, GCNConv, GINConv, WLConv, GAE
from torch_geometric.nn.glob.glob import global_mean_pool
import networkx as nx
# Useful libraries to visualize chemical structures and calculate chemical properties
import rdkit
from rdkit import Chem
from rdkit.Chem import Draw
from rdkit.Chem.rdMolDescriptors import CalcMolFormula
import deepchem as dc
# Notebook
from graph_converter import MoleculeDataset
from Utils import formula, draw_molecule, activity
Thanks to all!
I am using Python 3.7.3 installed from Anaconda. It has installed Ipython: I can invoke Ipython from the command line and running the following code in Jupyter notebooks I can see the ipython as an installed package
import subprocess
import sys
reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
print (installed_packages)
However in the same Jupyter notebook when I run the following code
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import pydotplus
from Ipython.display import Image
from sklearn.linear_model import LogisticRegression
from sklearn import tree
from sklearn.tree import DecisionTreeClassifier
from sklearn.decomposition import FactorAnalysis
from sklearn.cluster import KMeans
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix,accuracy_score,f1_score
I get the error returned : ModuleNotFoundError: No module named 'Ipython'
It's a Windows 10 machine. I tried reinstalling with conda install and conda update to no avail, and I tried variants of capitalisation.
You have a typo. The P in IPython is meant to be capitalized.
Use:
from IPython.display import Image
Here's my python import statements
import plotly as py
import pandas as pd
import numpy as np
import plotly.plotly as py
import plotly.tools as plotly_tools
from plotly.graph_objs import *
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()
from matplotlib.finance import quotes_historical_yahoo
import matplotlib.pyplot as plt
from scipy.stats import gaussian_kde
from IPython.display import HTML
It throws and ImportError ImportError: libSM.so.6: cannot open shared object file: No such file or directory
I know there is problem with this import statement
import matplotlib.pyplot as plt
Try this command if you are using ubuntu:
pyqt4 might be missing
sudo apt-get install -y python-qt4
It worked for me.
This depends on the backend you're using for matplotlib.
It appears you're on the Qt backend. To avoid installing Qt, you can change it to something native to your distribution, such as GTKAgg
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt