No module named 'tensorflow_fedarated' - python-3.x

I'm on windows but even in google Collab I cant import it.
and I do have proper internet.
from tensorflow_federated import python as tff

You can install the released TensorFlow Federated Python package using as shown below
!pip install --upgrade tensorflow-federated
Then you can import required modules as shown below
from tensorflow_federated import python as tff
Note: Currently you can install only on Ubuntu and macOS.
For more details you can refer you can refer here

Related

Azure machine learning studio Pipeline run: ModuleNotFoundError: No module named 'pyodbc'

Scenario:
1.I am using Machine learning studio for creating machine learning pipeline and when I am trying to call the .py file which has below code:
import os
os.system(f"pip install pandas")
os.system(f"pip install scikit-learn")
os.system(f"pip install pyodbc")
os.system(f"pip install SQLAlchemy")
import glob
import json
import pandas as pd
from sklearn import preprocessing
import logging
import os
import sys
import pyodbc
import urllib
from sqlalchemy.pool import NullPool
import sqlalchemy
and when I am trying to create and run pipeline from note book getting error:
Collecting pyodbc
Downloading pyodbc-4.0.32.tar.gz (280 kB)
Building wheels for collected packages: pyodbc
Building wheel for pyodbc (setup.py): started
Building wheel for pyodbc (setup.py): finished with status 'error
.....
....
....
...
ModuleNotFoundError: No module named 'pyodbc'
Below are the following workarounds that you can try to resolve the error:
Solution 1:
Install the Microsoft ODBC Driver for SQL Server on Windows, from installing microsoft pyodbc driver for SQL server.
Open the cmd.exe as an administrator
Navigate to the python scripts folder that contains pip
Type: pip install pyodbc
Also, refer this Configure development environment for pyodbc Python development document.
Solution 2:
Also if you have already had the pyodbc module installed , and if you are trying to reference it from another environment.
Right click the Python Environments in the Solution Explorer window.
select add/remove
Select the Python interpreter you want to use.
Refer this MSFT document for more information.
Solution 3:
Also to solve your problem you may try simply uninstalling and reinstalling pyodbc.
Use pip uninstall pyodb and confirm by Y to uninstall and then pip install pyodbc to reinstall.
References:
1 .SO import pyodbc leads to No module named pyodbc
2. Github No module named 'pyodbc'

Azure AutoML Python SDK, Issues importing into VS Code Jupyter Notebook

I have a .yml that installs all the necessary Azure ML packages.
Upon creating the environment with the YML, I test to make sure I can import the packages, and I can.
But when I open the Jupyter notebook I will be using and import the necessary packages, one is not found.
from azureml.train.automl import AutoMLConfig
ModuleNotFoundError: No module named 'azureml.train.automl.automlconfig'
But When I import it in the command prompt, it successfully imports
It seems like this is an issue with VS code, has anyone else encountered this?
I tried reproducing the issue while importing AutoMLConfig in VSCode as below:
Followed the below steps to fix it by installing its related Python packages.
Activate the virtual environment from below command
python -m venv .venv
.venv\Scripts\activate
Then install pip install azureml and “pip install azureml-core”
Pip install azureml-train
Pip install azureml-train-automl
Also, we have a Microsoft documentation where we have all the sub packages of azureml.

Module not found when I tried to import pyPDF2

My python version is 3.6. I am able to install the pyPDF2.
Ran pip install pyPDF2 successfully.
Ran pip list, it shows up as 1.26.0
My environment is not base, but I set up an environment as pytorch. pyPDF2 is installed successfully in this environment.
It pops error when I tried to import it. (typo fixed from the original post)
Your import pyPDF is incorrect. Instead try import PyPDF2.
Is also possible your pip does not match your python (this can be the case when multiple python versions are installed at the same time). Try running python -m pip list to confirm what exactly is installed.

How to install keras-rl in Anaconda

I am starting to work on a reinforcement learning model, but I am blocked at the moment as I have not been able to download one of the essential python packages yet: keras-rl.
More specifically, I would like to import the following 3 utilities:
from rl.agents.dqn import DQNAgent
from rl.policy import EpsGreedyQPolicy
from rl.memory import SequentialMemory
I use Anaconda (Spyder) for my coding activities, and I usually install the various packages via the CMD.exe Prompt.
However, I cannot seem to find on https://anaconda.org/ any information on this particular package.
Could someone assist please?
Thank you!
Makram
install pip via conda using
conda install pip
then you can use pip to install like here
pip install keras-rl2
and everything will work just fine

Jupyter Notebook ModuleNotFoundError: No module named 'sklearn.impute'

I'm importing the sklean.impute.SimpleImputer using
from sklearn.impute import SimpleImputer
But got an error
error: No module named 'sklearn.impute'.
Installed sklearn 0.19.1 using command !pip install sklearn. How to see if it's the development version? Also, where can I access the logs?
EDIT: The pip version of scikit-learn is now 0.20+.
The impute submodule is part of scikit-learn version 0.20. It is not on pypi yet, so if you have to use that function, install the dev version of scikit-learn by pip install git+https://github.com/scikit-learn/scikit-learn.git

Resources