Theano: where to input " theano-cache clear" - theano

To remove theano compile cache, Theano 0.9 document says using 'theano-cache clear'.
I don't know where to type the command. I am using anaconda with spyder. Does the command should be input in anaconda prompt, spyder console or cmd?
Typing the command in anaconda prompt yields the error message:
'theano-cache' is not recognized as an internal or external command,
operable program or batch file.
Is there other way in addition to the command to remove the cache?

I also met this error, I delete it in the folder: C:\Users\user\AppData\Local\Theano (maybe I am wrong). But in this way I didn't solve other problems later. I used pip install theano==0.8.2 to install an other version, and installed CUDA7.5, then it worked. My system is Windows 8.1, and my GPU is 830M.
Anyways, I found it is easy to install theano in linux, I have installed it in Ubuntu 16.04.
I hope it can help you.

Related

PyCharm cannot find gdal libraries when using os system in WSL Ubuntu

The problem is that within the PyCharm editor, the gdal applications (e.g. gdalwarp or gdal_grid https://gdal.org/) cannot be found when using os.system. For example the code:
os.system(f"gdalwarp -t_srs EPSG:27700 {fnc} {tname}")
returns this error message 'sh: 1: gdalwarp: not found'.
I am using PyCharm interpreter with the following settings:
Ubuntu WSL platform
conda environment with gdal libaries installed.
When I run the code from the ubuntu terminal, it does find the gdal libraries. So I don't think the problem is within the conda environment, but there is a problem with PyCharm settings to find the gdal application using os system.
I do not want to change the code, but I would rather figure out the correct PyCharm settings. Any help would be greatly appreciated.

Just updated Ubuntu to 22.04, now I can't open Jupyter Notebook

When I try to launch Jupyter Notebook, the browser launches and I get the following error:
Access to the file was denied
The file at /home/benjamin/.local/share/jupyter/runtime/nbserver-11758-open.html is not readable.
It may have been removed, moved, or file permissions may be preventing access.
I tried running
jupyter lab clean --all
pip3 install jupyterlab --force-reinstall
as per the suggestion from here: Jupyter Notebook: Access to the file was denied. The commands ran, but I still get the Access to the file was denied error. Also, on the reinstall command it spits this out:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spyder 4.2.5 requires pyqt5<5.13, which is not installed.
spyder 4.2.5 requires pyqtwebengine<5.13, which is not installed.
conda-repo-cli 1.0.4 requires pathlib, which is not installed.
anaconda-project 0.9.1 requires ruamel-yaml, which is not installed.
spyder 4.2.5 requires jedi==0.17.2, but you have jedi 0.18.1 which is incompatible.
spyder 4.2.5 requires parso==0.7.0, but you have parso 0.8.3 which is incompatible.
sphinx 4.0.1 requires Jinja2<3.0,>=2.3, but you have jinja2 3.1.1 which is incompatible.
sphinx 4.0.1 requires MarkupSafe<2.0, but you have markupsafe 2.1.1 which is incompatible.
python-language-server 0.36.2 requires jedi<0.18.0,>=0.17.2, but you have jedi 0.18.1 which is incompatible.
fermipy 1.0.1+5.g5a57 requires astropy<4, but you have astropy 4.2.1 which is incompatible.
which may or may not be part of the problem.
Cross posted here: https://discourse.jupyter.org/t/after-updating-to-ubuntu-22-04-i-am-no-longer-able-to-access-jupyter-notebook/13991
here: https://askubuntu.com/questions/1404330/after-updating-to-ubuntu-22-04-i-am-no-longer-able-to-access-jupyter-notebook
and on reddit: https://www.reddit.com/r/learnpython/comments/uaipzo/i_just_updated_my_machine_to_ubuntu_2204_now_i/
UPDATE: I am able to access the notebook now by using the URL printed to the console. (just copy and paste it into the Firefox browser)
I would still like to figure out how to get it to open with just the 'jupyter notebook" command the way it used to work before the update, but for now this is a useful workaround.
did you try setting
c.NotebookApp.use_redirect_file = False
In the jupyter_notebook_configuration.py file?
If you tried, did you remove the '#' at the start of the line?
I had the same problem with Ubuntu 22.04 and this fixed it.
I first created the file with :
jupyter notebook --generate-config
then I uncommented and change the line c.NotebookApp.use_redirect_file as you said
and now it works !
I faced the same issue using Firefox from snap on Ubuntu 22.04.
I noticed that setting c.NotebookApp.use_redirect_file = False in generated jupyter_notebook_config.py works when launching jupyter notebook, but fails for jupyter-lab (error you pasted). I found that doing something similar to fix the problem for jupyter-lab:
jupyter server --generate-config
Then edit the generated ./jupyter/jupyter_server_config.py and set c.ServerApp.use_redirect_file = False. Now running jupter-lab works in snap firefox too. Maybe you can try this way and just run via jupyter-lab if it works for you too.
Btw. none of this is needed if you just use Chrome, somehow the problem only occurs for firefox from snap on Ubuntu 22.04.
Otherwise you could check out jupyter notebook --debug and/or reinstalling JupyterLab.
I use epiphany web browser instead of Firefox as a default web browser and everythings work fine
The problem I found is that the launcher is not using a path to Jupyter Notebook that works. From terminal I get:
$ whereis jupyter-notebook
jupyter-notebook: /home/brombo/miniconda3/bin/jupyter-notebook /home/brombo/.local/bin/jupyter-notebook
The command /home/brombo/miniconda3/bin/jupyter-notebook will start notebook but /home/brombo/.local/bin/jupyter-notebook will not. If you use the first in the exec line of .local/share/applications/jupyter-notebook.desktop everything works -
[Desktop Entry]
Name=Jupyter Notebook
Comment=Run Jupyter Notebook
Exec=/home/brombo/miniconda3/bin/jupyter-notebook %f
Terminal=true
Type=Application
Icon=notebook
StartupNotify=true
MimeType=application/x-ipynb+json;
Categories=Development;Education;
Keywords=python;

Issue on Installing Anaconda for Windows 10

I installed Anaconda 3 (Python 3.7.3 64-bit) from file Anaconda3-2019.03-Windows-x86_64.exe but I can't find Anaconda Navigator between my desktop apps. I followed some (very) similar questions on this forum but, e.g. after having opened the command terminal and dialed the command:
anaconda-navigator
I obtained the error text:
'anaconda-navigator' is not recognized as an internal or external command, operable program or batch file.
How do I fix this? Thank you!
I had the same problem on windows 10 64x, the only way to make it work was by uninstalling python and anaconda and installing the anaconda 86x.

Anaconda Python for Gurobi 6.0.4 installation _Py_FalseStruct error

In order to run an optimization problem we set up Gurobi 6.0.4 together with
Anaconda (Version 2.2.0) Python (Python 2.7.9.) on
Linux CentOS release 6.6 (Final) with the 2.6.32-504.16.2.el6.x86_64 Kernel
Following the installation guidelines of Gurobi (listed here: http://www.gurobi.com/documentation/6.0/quickstart_linux.pdf)
everything worked out in the first step. Gurobi was installed, could obtain a license. Also the PATH variables have been set (in the .bashrc) according to the manual, with a little extension for the referal to anaconda python (and not the other local Versions of python (being 2.7 and 3.4):
export GUROBI_HOME="/opt/gurobi604/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin:${PATH}:opt/anaconda/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib"
Following the procedure we executed: python2.7 setup.py install in the respective directory /opt/gurobi604/linux64. After this usually you could run the import gurobipy command in the python interpreter wihtout errors. For older Versions of Gurobi (as 5.6.3) this works out very well.
For 6.0.4 though we constantly receive the error:
ImportError: /opt/anaconda/lib/python2.7/site-packages/gurobipy/gurobipy.so: undefined symbol: _Py_FalseStruct
This is very reproducible, no matter if we put anaconda also in the global path, and check the bash for any overwriting of the environment variables, which is not the case.
On Windows 8 the Gurobi 6.0.4 and Anaconda Python 2.2.0 work together without any problems.
Also applying hints from here: Python Module Error on Linux did not work out.
Did anyone else experience these problems with this tooling combination? thx.
The error message indicates that you use the Python module for version 3.4 in your Python 2.7 package directory. This can happen if you do not clean your Python module build directory between builds. Please try the following:
Completely remove the 2.7 package from your Python 2.7 installation (e.g. remove /opt/anaconda/lib/python2.7/site-packages/gurobipy)
Completely remove the Python module build directory from your Gurobi installation (e.g. /opt/gurobi604/linux64/build)
Re-run the build process for the Python 2.7 module (e.g. run "python2 setup.py install" in /opt/gurobi604/linux64)
Please note that CentOS is currently a non-supported platform for Gurobi.
Thank you for the hint, I think we tried that, but did not finish the procedure in this way. We tried to clean the system but in that particular case still hat both python Versions (due to other applications that use 3.4) on the machine. Our solution in this case was just to reinstall everything clean on a Ubuntu 14.04 VM. Since then no further problems occured. (I know not the cleanest solution.)
We had some similar issues when we updated to Gurobi 6.5, but that could be solved when corrctly addressing the usual path issues.
Thank you in any case for the reply, I think this really will help us with the next, then clean deployment :-)

Error installing Pygame / Python 3.4.1

I'm trying to install Pygame and it returns me the following error "Python version 3.4 required which was not found in the registry". However I already have the Python 3.4.1 installed on my system. Does anyone know how to solve that problem?
I've been using Windows 8.1
Thanks in advance.
Are you using a 64-bit operating system? Try using the 32-bit installer.
Tips I can provide:
Add Python to your Path file in the Advanced settings of your Environmental Variables (just search for it in the control panel)
Something may have gone wrong with the download of Python, so re-install it. Also don't download the 64-bit version, just download the 32-bit version from the main pygame website
Once that's sorted out, transfer the entire Pygame file to the site packages in the Python directory and open up the pygame file and go to this directory in command prompt. Finally, run the Pygame setup from the command prompt which should be something like:
python setup.py
But this will only work if the pygame setup file is called setup.py (it's been a while since I downloaded it), you added Python to the Path file and you're currently in the correct directory in command prompt.
To test if it worked try importing pygame and see if you got an error or not.

Resources