unable to import spss module in watson studio - watson-studio

I am trying to import the built in spss module for Time Forecasting.
But I am receiving the following error on running the import command in watson notebook
ModuleNotFoundError Traceback (most recent call last)
in
----> 1 from spss.ml.forecasting.timeseriesexploration import TimeSeriesExploration
ModuleNotFoundError: No module named 'spss'
Please let me know what resolution can be done or if any step needs to be done before import.
On running the command !pip install com.ibm.spss, the following error gets displayed
Collecting com.ibm.spss
ERROR: Could not find a version that satisfies the requirement com.ibm.spss (from versions: none)
ERROR: No matching distribution found for com.ibm.spss

Notebooks and SPSS modeller are two distinct features of Watson Studio, which use separate backends to run your computations. The SPSS modeller code is not installed in the Notebook runtimes. Neither is it open source code on PyPI, so you cannot install it with pip.
To use built-in SPSS modules, you have to work with the SPSS modeller feature instead of the Notebooks feature.

Related

Unoconv. ERROR: cannot import name 'Element' from 'base'

I have some troubles with run unoconv converting in docker. On local machine all is good.
unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib/libreoffice
ERROR: No module named 'uno'
unoconv: Cannot find a suitable office installation on your system
OK, I install uno (pip3 install uno). I also tryed to install python3-uno and unotools, but it isn't help. (I receive message No module named 'uno').
So, I installed uno and now I receive message
unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib/libreoffice
ERROR: No module named 'base'
unoconv: Cannot find a suitable office installation on your system
And after base installing (pip3 install base):
unoconv: Cannot find a suitable pyuno library and python binary combination in /usr/lib/libreoffice
ERROR: cannot import name 'Element' from 'base' (/usr/local/lib/python3.9/site-packages/base/__init__.py)
unoconv: Cannot find a suitable office installation on your system.
And really in base.py no Element:
#coding:utf8
import re
class Base():
def fenge(self,content):
return [content] + re.split(r'[。\n]\s*', content)
It seems I need to install another package, but I do not know which one (in pip list on local machine I didn't find something required (on my view)). it doesn't seem to be on the local machine!
I'm ready to show code or installed packages if it required.
I am looking forward to counter questions or advice.

No module named 'manipulation'

I am using Ubuntu 22.04 LTS via WSL and working on Python 3.10. When I try to run Drake tutorials locally with python3 -m pydrake.tutorials I get the following error: ERROR: the Jupyter notebook runtime is not installed! which is not the case since I already installed jupyter-notebook using sudo apt-get install jupyter-notebook and can easily open a jupyter notebook myself when typing jupyter notebook.
Additionally, I tried to copy-paste and run the following code from a tutorial:
import pydot
from IPython.display import HTML, SVG, display
from pydrake.all import (AddMultibodyPlantSceneGraph, DiagramBuilder,
FindResourceOrThrow, GenerateHtml,
InverseDynamicsController, MeshcatVisualizer,
MeshcatVisualizerParams, MultibodyPlant, Parser,
Simulator, StartMeshcat)
from manipulation import running_as_notebook
and i get the following error:
ModuleNotFoundError: No module named 'manipulation'
It seems as I don't have a module called manipulation except the one inside pydrake library. Is this a version issue?
I desired to mention it in case the two errors are interconnected.
None of the tutorials in Drake import anything from manipulation. The manipulation textbook repository examples absolutely do. You can find more about those here: https://manipulation.csail.mit.edu/drake.html .

Spyder not handling relative imports

I am attempting to python3 proof my work and spyder seems to be having an issue with absolute_import.
For demonstration purposes I created two simple files. caller and callme
caller
from __future__ import absolute_import
from .callme import helloWorld
def runme(msg):
helloWorld(msg)
if __name__ == "__main__":
runme('It worked!')
callme
def helloWorld(msg):
print("helloWorld's message is '{}'".format(msg))
if __name__ == "__main__":
helloWorld('Hi')
When attempting to run caller from spyder I get the following error:
ValueError: Attempted relative import in non-package
Running from ipython via the anaconda prompt (python 2) or from jupyter notebook (running python3 or python2) both work properly.
Ideas on how to fix spyder's behavior so it properly recognizes absolute_import?
Spyder versions tried:
3.2.4 Python 2.7.14 64bits, Qt 5.6.2, PyQt5 5.6 on Windows 10
3.3.2 Python 2.7.14 64-bit | Qt 5.6.2 | PyQt5 5.6 | Windows 10
Update
Updating spyder via conda update spyder (now version 3.3.2) did not fix the issue.
If you run python caller.py in a system terminal, you'll get exactly the same error as the one you posted, i.e.
ValueError: Attempted relative import in non-package
So this is not a problem with Spyder (because Spyder runs something similar to python caller.py when you execute a file with Run > Run), but with the way relative imports works.
Please see this answer for a proper explanation:
https://stackoverflow.com/a/11537218/438386
In essence, you can't use relative imports in scripts.
Note: There's a workaround to avoid this error, as described in this answer:
https://stackoverflow.com/a/11536794/438386
However, we don't have the ability to execute a script as a package in Spyder, sorry.

kuka_grasp_block_playback.py from bulletphysics/bullet3 (pybullet library) not running on my system.

I downloaded the bullet3 github repository (Bullet Physics SDK) from https://github.com/bulletphysics/bullet3.git which contains python bindings for OpenAI Gym examples to run Reinforcement Learning Algorithms.
I tried running the kuka_grasp_block_playback.py example present in the following directory: bullet3-master/examples/pybullet/examples/
My system does not support pybullet.GUI and so I went ahead with pybullet.DIRECT.
But, on running it using python kuka_grasp_block_playback.py, its giving me the following error:
Traceback (most recent call last):
File "kuka_grasp_block_playback.py", line 92, in <module>
stepIndex = int(p.readUserDebugParameter(stepIndexId))
pybullet.error: Failed to read parameter.
How to deal with this ?
This is an out-of-date question, but just in case:. the latest version of pybullet contains a similar KUKA grasping implementation as OpenAI Gym environment. Just run 'sudo pip install pybullet' to get it.
This gym environment can be run without GUI without issue. See the quickstart guide at http://pybullet.org for more info about those pybullet Gym environments for Deep Reinforcement Learning.
The readUserDebugParameter only executes when using GUI mode, it fails in DIRECT mode, so just comment it out.

python-oauth2 on python 3x and windows

I want to setup an oauth library for Python on my windows desktop. I am newbie and this is my second day on Python and I having a tonne of trouble.
I downloaded the python-oauth2 (hudson-python-oauth2-167.zip) from github. I have extracted this to my python32 folder. When I run the setup command "python setup.py", I first got a syntax error on the print statement. I assumed it is because I am running on windows and so I changed it and then ran the setup.
I then got the following error:
Traceback (most recent call last):
File "C:\Python32\simplegeo-python-oauth2-1920657\setup.py", line 2, in
from setuptools import setup, find_packages
ImportError: No module named setuptools
Can someone guide me with setting up python-oauth2? Am I missing something basic here?
You need to install Distribute, which is a fork of setuptools that supports Python 3.
That said, your syntax error was because python-oauth2 doesn't seem to run on Python 3 yet, so you need to either help port it, or use Python 2.7.

Resources