TypeError("__init__() got an unexpected keyword argument 'capture_validation_error'" - jupyter-lab

I updated jupyter and conda, then after opening jupyter lab, when I tried to open a notebook, I got an error of below. The file was working fine without any error before.
Unreadable Notebook: U:\Data\test.ipynb TypeError("__init__() got an unexpected keyword argument 'capture_validation_error'")
the same file can be opened in other pc with old enviroment. not sure what is the problem?
Thanks for your help

I fixed it by using python3.9. I use a conda environment to handle the versioning.
Create an environment with python3.9
conda create -n myenvpython39 python=3.9
Activate the environment
conda activate myenvpython39
Install jupyterlab within myenvpython39
conda install -c conda-forge jupyterlab

Related

MAC OS Unable to update, uninstall, pip install, sudo, conda prompts, always get "An unexpected error has occurred."

I have come to find out that I have several Python paths. Using Jupyter, SQ, I cannot find anyway online that shows me exactly my issue and resolving my path issues.
I have done all the below and then some. No matter what I try it gives me the same issue, "An unexpected issue..." I need conda and my environments and Conda will not open. I really need help removing Python paths and getting Conda to work again. The following shows my Python paths in VS code and I found the paths below that to be my 2 main paths in Jupyter. (Kernel dies as well) I'm am new to data analysis and I have followed the download instructions for all my lessons to the exact click. I have been having this issue for a few weeks, I have tried multiple terminal prompts, unfortunately I cannot remember them all. All of them are from stack.
pythondata /Users/me/Library/Jupyter/kernels/pythondata
python3 /Users/me/opt/anaconda3/share/jupyter/kernels/python3
Path=
import sys,os (tried changing or adding files)
conda info
conda list
conda install/uninstall
conda update
sudo chown...
sudo conda update (-n base conda, anaconda-navigator, navigator-update)
pip installs
conda install python=3.6
conda config --set allow_conda_downgrades true
conda install conda=4.6.14
at least 20 other commands, I started writing them down today...
I have really tried A LOT and all of these commands I get unexpected error.

conda installed some package but still ModuleNotFoundError when import this package

I've found the solution:anaconda - graphviz - can't import after installation
I want to use graphviz and follow the commend in https://anaconda.org/anaconda/graphviz
run following in terminal
conda install -c anaconda graphviz
However no matter in Jupyter Notebook, python or Pycharm to import graphviz, it always shows
ModuleNotFoundError: No module named 'graphviz'
How to solve this problem? Thank you.
PS:
when run which python in terminal: it return /opt/anaconda3/bin/python, therefore I use anaconda environment by default. And I have only one environment in anaconda that is root.
when I run conda list in terminal, I can find this line :
graphviz 2.40.1 hefbbd9a_2
I found a weird thing:
my pip and conda use the same environment:
run :which pip
get : /opt/anaconda3/bin/pip
run : which conda
get : /opt/anaconda3/bin/conda
However when I run pip list, I cannot find graphviz and many other packages which shows in conda list. For these packages show in conda list but not in pip list, I also cannot import them no matter in Jupyter notebook, python, pycharm etc. Why this happens?
After using "conda install attrs", other package installations are working fine without any http connection or ModuleNotFoundError errors. Please try and let me know.

Can't install Spyder through Anaconda Navigator

I cannot install Spyder through Anaconda Navigator. I am a complete beginner when it comes to Python and I have no idea what's going wrong.
I have to create a new environment and open a project there.
What I did so far is: through Anaconda Navigator (1.9.7) I created a new environment (with Python 3.6). Then, for this specific environment I try to install Spyder. I click the 'install' button, a progress bar appears and then nothing happens.
I tried the same steps on friend's laptop and when I click install there, the progress bar also appears. When it's done the 'install' button changes to 'launch'. The only difference that I see between our computers is that I have Windows10 and he has a Macbook. I don't know whether this could be the problem somehow.
How can I install Spyder for a specific environment? What's going wrong with my installation in Anaconda Navigator?
Also, when I try to install Spyder through Anaconda Prompt (with Administrator privileges), I get the following error:
Preparing transaction: done
Verifying transaction: done
Executing transaction: failed
ERROR conda.core.link:_execute(568): An error occurred while installing package 'defaults::openssl-1.1.1b-he774522_1'.
PermissionError(13, 'Permission denied')
Attempting to roll back.
Rolling back transaction: done
[Errno 13] Permission denied: 'C:\\Users\\eweli\\Anaconda3\\envs\\HAABSA\\Library\\bin\\libssl-1_1-x64.dll'
I managed to solve this by going to the directory where the file libssl-1_1-x64.dll is located (in your case, C:\Users\eweli\Anaconda3\envs\HAABSA\Library\bin\). Then, I removed the file (by cutting and pasting it to the desktop, just to be safe) and ran the installation command again in an Anaconda prompt (with admin rights):
conda install -c anaconda spyder
After that, the installation went smoothly and a new version of libssl-1_1-x64.dll was created in the corresponding directory (thus I deleted the one I moved previously).
To install spyder, go to the command line and to the directory where you work. Activate your virtual environment by typing
conda activate environment_name
Then once that returns just type
conda install spyder
This should install spyder in your virtual environment.
I had the same issue today, and weirdly a lot of versions didn't work out for me. However, what worked was to go to anaconda prompt, activate the environment and then type
conda install -c conda-forge spyder
Go the directory of your environement in terminal and type :
conda install -c anaconda spyder
it worked well for me.

Spyder crashing after installing Keras through Conda

I downloaded Anaconda on a PC. I would like to use TensorFlow and Keras. I know I have to use Python 3.6 and TensorFlow 1.0.9 (because of my code).
After installing Anaconda, I open my Anaconda prompt (in admin) and I put these instructions to create a new env:
conda create --name deeplearningaz python=3.6 anaconda
activate deeplearningaz
conda install theano
conda install tensorflow
conda install keras
conda update --all
I don't have any errors, but a warning about updating Conda version, and a few debug messages.
After that, I try to check if I'm using the correct version of Python, so I type (still in Anaconda prompt) and import keras (to see if it's ok):
python
import keras
Everything works perfectly fine.
Then I type quit() and type spyder (to open the Spyder from the env in Python 3.6).
Spyder opens, and if I type anything (import pandas, numpy et read a csv), then it crashes... for no reason (and no error).
After that, still in the Anaconda prompt, I try again to open Spyder and I get an error:
I don't get the problem, I try again and again to uninstall and install anaconda (and checking if my file was really delete). I didn't find...
I check the print(sys.path) and it looks like it's ok (but I don't see the env).
Does anybody have any idea?
I put here the conda info in the env (before the crash).
I don't use Spyder, but based on this discussion about how they don't really support switching conda envs yet, it sounds like currently the correct way to get Spyder to use a Conda env is to launch Spyder from outside the env, and then change the Python interpreter (Tools > Preferences > Python Interpreter) to point to the python located inside the env you wish to use.
Or if you really don't care about space, simply install a new Spyder instance in the env (conda install -n deeplearningaz spyder), and then you should be able to launch within the env without issue.

pip3 not found in Tensorflow environment: "-bash: pip3: command not found"

I'm following instructions to create a Tensorflow environment for a Machine Learning course, with python 3.5, ipython and jupyter.
I created a Tenserflow environment with python 3.5 using conda create -n tensorflow python=3.5. That worked.
Then I ran conda install -c conda-forge tensorflow. That also worked.
Then I installed ipython with conda install ipython, which also worked fine.
However, when I ran pip3 install jupyter, I got error message bash: pip3: command not found.
I found a few posts about variations on pip3 problems and (within the Tensorflow environment):
When I type pip --version, it tells me I have version 8.1.2
When I try locate pip3, I get WARNING: The locate database (/var/db/locate.database) does not exist
I tried using pip-3.2 as recommended in one of the other questions' solutions (which worked for that OP), and I get the same command not found error message.
I'm using OS X 10.8.5
pip is different from pip3. So you might need to install it if it can't be found. If it is installed run this:
sudo updatedb
this will update the locate function.
if you're using conda why do you want to install it with pip anyways?
Jupyter is the new version of ipython. running conda install ipython installs ipython (now jupyter).

Resources