Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
StaSH problem
-
Toaday I tried to install a package via pip inside StaSH, but I received the following error (in Pythonista v3.1):
[~/Documents]$ pip install 'AnyPackage'
stash: <type 'exceptions.TypeError'>: call() takes exactly 2 arguments (1 given)I tried updating stash and also uninstalling it, but the result is the same. Please anybody have the same performance or have some idea to solve this problem?
Thanks in advance. -
-
please use stashconf py_traceback 1 then try again, and paste the full traceback.
Is AnyPackage a pypy package, or are you saying you tried it with multiple packages?
-
Also, try without quotes around AnyPackage.
-
@JonB AnyPackage is just any package (without quotes).
-
@JonB following is the full traceback:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/2E09C07F-FFBD-4F5A-909A-C6BF44699985/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 498, in exec_py_file
exec code in namespace, namespace
File "site-packages/stash/bin/pip.py", line 1205, in <module>
ensure_pkg_resources() # install pkg_resources if needed
File "site-packages/stash/bin/pip.py", line 287, in ensure_pkg_resources
import pkg_resources
File "/private/var/mobile/Containers/Shared/AppGroup/2E09C07F-FFBD-4F5A-909A-C6BF44699985/Pythonista3/Documents/site-packages/pkg_resources/init.py", line 72, in <module>
import packaging.requirements
File "/private/var/mobile/Containers/Shared/AppGroup/2E09C07F-FFBD-4F5A-909A-C6BF44699985/Pythonista3/Documents/site-packages/packaging/requirements.py", line 59, in <module>
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
TypeError: call() takes exactly 2 arguments (1 given)
[~/Documents]$ -
which package specifically are you having issues with
-
@JonB with any package that I try to install
-
Your pkg_resources install looks bad.
[~/Documents]$ rm -rf ~/Documents/site-packages/packaging [~/Documents]$ rm -rf ~/Documents/site-packages/pkg_resources/
then force quit pythonista, and try again
-
Thanks @JonB !
I changed the pkg_resources, forced pythonista to quit and started again, but now, after the "Querying PyPI" message, this is the traceback:Querying PyPI ...
stash: <class 'xmlrpclib.Fault'>: <Fault 1: "<type 'exceptions.TypeError'>:datetime.datetime(2017, 1, 25, 23, 9, 38, 332239) is not JSON serializable">Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/2E09C07F-FFBD-4F5A-909A-C6BF44699985/Pythonista3/Documents/site-packages/stash/system/shruntime.py", line 498, in exec_py_file
exec code in namespace, namespace
File "site-packages/stash/bin/pip.py", line 1208, in <module>
repository.install(pkg_name, ver_spec)
File "site-packages/stash/bin/pip.py", line 940, in install
archive_filename, pkg_info = self.download(pkg_name, ver_spec)
File "site-packages/stash/bin/pip.py", line 911, in download
downloads = self.pypi.release_urls(pkg_name, hit)
File "/var/containers/Bundle/Application/D0BD4051-36A4-4B3F-8BF7-3681CA38C7E3/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/xmlrpclib.py", line 1244, in call
return self.__send(self.__name, args)
File "/var/containers/Bundle/Application/D0BD4051-36A4-4B3F-8BF7-3681CA38C7E3/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/xmlrpclib.py", line 1603, in __request
verbose=self.__verbose
File "/var/containers/Bundle/Application/D0BD4051-36A4-4B3F-8BF7-3681CA38C7E3/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/xmlrpclib.py", line 1284, in request
return self.single_request(host, handler, request_body, verbose)
File "/var/containers/Bundle/Application/D0BD4051-36A4-4B3F-8BF7-3681CA38C7E3/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/xmlrpclib.py", line 1317, in single_request
return self.parse_response(response)
File "/var/containers/Bundle/Application/D0BD4051-36A4-4B3F-8BF7-3681CA38C7E3/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/xmlrpclib.py", line 1494, in parse_response
return u.close()
File "/var/containers/Bundle/Application/D0BD4051-36A4-4B3F-8BF7-3681CA38C7E3/Pythonista3.app/Frameworks/Py2Kit.framework/pylib/xmlrpclib.py", line 801, in close
raise Fault(**self._stack[0])
Fault: <Fault 1: "<type 'exceptions.TypeError'>:datetime.datetime(2017, 1, 25, 23, 9, 38, 332239) is not JSON serializable"> -
I would look in your site-packages folder, and delete everything, including stash, and do a fresh stash install. Force quit pythonista and restart. Not sure how you had packaging installed in the wrong location before, but presumably there might be some other issues.
-
@JonB Thank you!
This worked fine