Running pyiron under Windows leads to error about .pyiron configuration - pyiron

I installed pyiron according to the instructions under Windows via conda. Everything worked without any errors. Then, I started a new notebook, and ran the commands:
from pyiron import Project
where I got the message:
Fall back to default configuration: {'resource_paths': ['~/pyiron/resources'], 'project_paths': ['~/pyiron/projects']}
and then, I tried to start a new project via:
pr = Project('test')
Here, errors occurred such as:
ValueError Traceback (most recent call last)
<ipython-input-2-f4cd01081291> in <module>
----> 1 pr = Project('test')
C:\Anaconda3\lib\site-packages\pyiron\project.py in __init__(self, path, user, sql_query)
108
109 def __init__(self, path="", user=None, sql_query=None):
--> 110 super(Project, self).__init__(path=path, user=user, sql_query=sql_query)
111 self.job_type = JobTypeChoice()
112 self.object_type = ObjectTypeChoice()
and finally, the message:
ValueError: the current path C:/Users/nau/pyiron/test/ is not included in the .pyiron configuration. ['C:/Users/nau/pyiron/projects/']
(nau is my user name). Do I have to initialize a file .pyiron in a certain folder first? If yes, how? The folder C:/Users/nau/pyiron/projects/ didn't exist.

This is a bug and should be fixed in the code - I am going to create a separate issue on Github shortly.
In the mean time you can fix it on your system, by either creating the folder manually:
C:/Users/nau/pyiron/projects/
And then execute the jupyter notebook in this folder.
Or you can create the pyiron configuration files by executing the following commands:
import pyiron
pyiron.install()
This is going to ask you:
It appears that pyiron is not yet configured, do you want to create a default start configuration (recommended: yes). [yes/no]:
And then you can confirm with yes which is going to create a C:/Users/nau/.pyiron file with the configuration. This file you can then update manually. By changing the line:
PROJECT_PATHS = C:/Users/nau/pyiron/projects/
to:
PROJECT_PATHS = C:/Users/nau/pyiron/
I hope this solves your issue.
Ps: Can you tell me which version of pyiron you are using? You can identify the version using conda list pyiron.

Related

plt.style.use('./deeplearning.mplstyle') is not working

I am trying to run the optional labs of the machine learning specialization from coursera, and I stuck with some libraries and functions that
I can not install
plt.style.use('./deeplearning.mplstyle')
I got the error message
ModuleNotFoundError Traceback (most recent call last)
in
3 import matplotlib.pyplot as plt
4 print(plt.style.available)
----> 5 plt.style.use('./deeplearning.mplstyle')
OSError: './deeplearning.mplstyle' not found in the style library and input is not a valid URL or path; see `style.available` for list of available styles
What can I do?
It is because you may did not download all the files from coursera. Make sure to download all the files, especially, deeplearning.mplstyle, lab_utils_common.py, lab_utils_multi.py and keep them in one folder.
You need to download the deeplearning.mplstyle file to use the plotting style.
To download this file from the Optional Lab follow these steps
Open the Optional Lab from your course.
Click on File -> Open
Select deeplearning.mplstyle and select download option on top
Save this file to your working directory. To use plt.style.use('./deeplearning.mplstyle') as is - make sure your main code file and deeplearning.mplstyle are in the same folder.

Import does not function as bat file; but works in spyder

I am still not the most sophisticated python user; but I cannot overcome this probably simple problem. I have a code that works perfectly with the spyder interface. I would like to make it a recurring task via creating a bat file. The bat file which in turn triggers a cmd interface does not import pandas_data reader and the code gets stuck and aborts.
import pandas_datareader.data as web
this line above creates the error below. It's a lengthy text.
File "C:\Users\myself\anaconda3\lib\site-packages\pandas_datareader\__init__.py", line 2, in <module>
from .data import ( File "C:\Users\myself\anaconda3\lib\site-packages\pandas_datareader\data.py", line 9, in <module>
from pandas.util._decorators import deprecate_kwarg File "C:\Users\myself\anaconda3\lib\site-packages\pandas\__init__.py", line 17, in <module>
"Unable to import required dependencies:\n" + "\n".join(missing_dependencies) ImportError: Unable to import required dependencies: numpy:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from "C:\Users\myself\anaconda3\python.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.17.0" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.

OpenAI Gym error running demo from intro page

I installed OpenAI Gym and attempted to run the getting-started cart-pole demo (https://gym.openai.com/docs/). (I'm running in a Colab notebook.)
import gym
env = gym.make('CartPole-v0')
env.reset()
for _ in range(1000):
env.render()
env.step(env.action_space.sample()) # take a random action
This doesn't learn, but it should display the cart and pole.
When I run it I get a warning and an error.
WARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype.
The error is triggered by env.render(). At the bottom of the Traceback is
Error occured while running `from pyglet.gl import *`
The original exception was:
ImportError: Library "GL" not found.
I had installed pyOpenGL with the following.
!pip install PyOpenGL PyOpenGL_accelerate
I'd appreciate help with both the warning and the error. Is there another GL library I should install?
Thanks.
Google Colab is run in the cloud. It can't send the graphic display back to your monitor.
You can try running it with local runtime.
https://research.google.com/colaboratory/local-runtimes.html
Do you get this window?
If yes then try to add this import:
import time
and this line of Code within the for-loop:
time.sleep(0.3)
Thing is that the pole runs out of view rather quick, so it seems like
the Environment did not run at all.

unittest in tensorflow, python session_test.py, got a exception

I'm trying to run session_test.py from https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/client/session_test.py, So in my anaconda, tensorflow virtual env, I went to the corresponding directory in tensorflow like ../master/tensorflow/python/client/.. and run
python session_test.py
I got exception info like this:
Traceback (most recent call last):
File "session_test.py", line 32, in
from tensorflow.core.protobuf import cluster_pb2
ImportError: cannot import name 'cluster_pb2'
What package I should install or related documents that I could read about it. Is there anyone trying to do the same thing, run those unit test coming along with each module in tensorflow repo?
Please help me, thanks!
That line was added just a couple of weeks ago (see commit), and relates to a new feature being implemented in TensorFlow. Unless you have compiled and installed a very bleeding-edge version of TensorFlow you won't be able to run it. Instead, try to run the script corresponding to the version of TensorFlow that you have installed (for example, this is for version 1.1.0, the latest stable release at the time of writing).

Plone 4.3 and transmogrifier installation

I am trying to migrate content from old 3.x Plone installation to new Plone 4.3 instance. Both are running on windows platforms.
In new 4.3 installation I am trying to install quintagroup.transmogrifier and instance does not start.
bin\instance.exe fg gives following:
clip
Presumably normal entries removed...
clip
File "c:\plone43\eggs\zope.configuration-3.7.4-py2.7.egg\zope\configuration\config.py", line 179, in resolve
mod = __import__(mname, *_import_chickens)
File "c:\plone43\eggs\quintagroup.transmogrifier-0.4-py2.7.egg\quintagroup\transmogrifier\writer.py", line 13, in <module>
import quintagroup.transmogrifier.patches
File "c:\plone43\eggs\quintagroup.transmogrifier-0.4-py2.7.egg\quintagroup\transmogrifier\patches.py", line 89, in <module>
from tarfile import nts, GNUTYPE_SPARSE, normpath
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "c:\Plone43\parts\instance\etc\site.zcml", line 15.2-15.55
ZopeXMLConfigurationError: File "c:\Plone43\parts\instance\etc\package-includes\002-quintagroup.transmogrifier-configure.zcml", line 1.0-1.70
ZopeXMLConfigurationError: File "c:\plone43\eggs\quintagroup.transmogrifier-0.4-py2.7.egg\quintagroup\transmogrifier\configure.zcml", line 67.4-70.10
ImportError: cannot import name normpath
Is this something that transmogrifier is not allowd to load python module (v.2.7) in Plone or cannot find it from windows?
How could I fix the issue or approach it further?
I tried, just to copy data.fs to new site, but it seems to import a lot of "crap" from old version as well and some of the functionality dows not work properly.
I am not thet familiar with Plone/Zope/Python, but so far I have managed to get the job done.
Thanks
It's a bug in quintagroup.transmogrifier that has been fixed but not yet released.
For now, you can use the version on Github. If you are using mr.developer, the easiest way is to amend your buildout.cfg as follows:
[sources]
quintagroup.transmogrifier = git git://github.com/collective/quintagroup.transmogrifier.git