IOError: [Errno 13] Permission denied when trying to import and use plotly - windows

I am running a flask application using plotly for some of my charting figures, and it runs fine on my work pc.
I have just tried to run it on my personal pc and on starting the local host server I am getting the following message:
Traceback (most recent call last):
File "controller.py", line 14, in <module>
from plotly.offline import plot
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\__init__.py", line 31, in <module>
from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\plotly\__init__.py", line 10, in <module>
from . plotly import (
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\plotly\plotly.py", line 29, in <module>
from plotly import exceptions, files, session, tools, utils
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\tools.py", line 403, in <module>
#utils.template_doc(**get_config_file())
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\tools.py", line 241, in get_config_file
ensure_local_plotly_files() # make sure what's there is OK
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\tools.py", line 94, in ensure_local_plotly_files
utils.save_json_dict(fn, contents)
File "C:\Users\StuJ7\Anaconda2\lib\site-packages\plotly\utils.py", line 61, in save_json_dict
with open(filename, "w") as f:
IOError: [Errno 13] Permission denied: 'C:\\Users\\StuJ7\\.plotly\\.credentials'
So it's obvious from the error message that it is an issue with permissions regarding the .plotly.credentials file - but I have assigned myself full permissions to the whole .plotly folder through the security settings and I have also pip installed plotly as an administrator.
I've tried extensive Googling , but there doesn't seem to be much windows related advice regarding this particular issue.
Can anyone suggest how I can get this to work.

Related

Python virtual Env, Py2app build, error with wxpython

I have created a virtual env on MacOS 10.14, with python 2.7, pip installed py2app, wxpython, etc, ran the Py2app command:
sudo python setup.py py2app
Upon running the app, I see the below error:
(ENV) kevins-MacBook-Pro:Audio_Export_App kevin$ /Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/MacOS/Audio_Export_App_V3.3
Traceback (most recent call last):
File "/Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/Resources/__boot__.py", line 107, in <module>
_run()
File "/Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/Resources/__boot__.py", line 82, in _run
exec(compile(source, path, 'exec'), globals(), globals())
File "/Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/Resources/Audio_Export_App_V3.3.py", line 1, in <module>
import wx
File "wx/__init__.pyc", line 17, in <module>
File "wx/core.pyc", line 12, in <module>
File "wx/_core.pyc", line 14, in <module>
File "wx/_core.pyc", line 10, in __load
ImportError: dlopen(/Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core.so, 2): Symbol not found: __ZThn1216_N10wxTextCtrl3CutEv
Referenced from: /Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core.so
Expected in: /usr/local/lib/libwx_osx_cocoau_core-3.0.0.4.0.dylib
in /Users/kevin/python_scripts/Audio_Export_App/dist/Audio_Export_App_V3.3.app/Contents/Resources/lib/python2.7/lib-dynload/wx/_core.so
2018-10-17 07:58:27.927 Audio_Export_App_V3.3[10303:567300] Audio_Export_App_V3.3 Error
2018-10-17 07:58:28.070 Audio_Export_App_V3.3[10303:567300] GetInputSourceEnabledPrefs user file path = /Users/kevin/Library/Preferences/com.apple.HIToolbox.plist
2018-10-17 07:58:28.070 Audio_Export_App_V3.3[10303:567300] GetInputSourceEnabledPrefs effective user id path = 501
2018-10-17 07:58:28.070 Audio_Export_App_V3.3[10303:567300] GetInputSourceEnabledPrefs user pref content = <CFBasicHash 0x10017c320 [0x7fff9887c8e0]>{type = immutable dict, count = 0,
entries =>
}
I have searched high and low for a solution, but cannot find one.
Anyone able to shed some light on this issue please?
This is an issue with Py2App. It can be solved by manually specifying the wx package during the build process:
python setup.py py2app --packages=wx
Hope that helps.
Source: https://bitbucket.org/ronaldoussoren/py2app/issues/252/py2app-creates-broken-bundles-with

SerpentAI Installation error

I have been trying to install SerpentAI. I am on a Mac, and I have followed all the steps. I have all the dependencies, but when I use the keyword serpent it gives me this error.
I know I am missing a config file but I don't know where to find it, or how to solve this.
Any command that started with serpent gave me this error.
Here is the error
Traceback (most recent call last):
File "/anaconda3/bin/serpent", line 11, in <module>
load_entry_point('SerpentAI==2018.1.2', 'console_scripts', 'serpent')()
File "/anaconda3/lib/python3.6/site- packages/pkg_resources/__init__.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2691, in load_entry_point
return ep.load()
File "/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2322, in load
return self.resolve()
File "/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2328, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/anaconda3/lib/python3.6/site-packages/SerpentAI-2018.1.2-py3.6.egg/serpent/serpent.py", line 11, in <module>
from serpent.utilities import clear_terminal, display_serpent_logo, is_linux, is_macos, is_windows, is_unix, wait_for_crossbar
File "/anaconda3/lib/python3.6/site-packages/SerpentAI-2018.1.2-py3.6.egg/serpent/utilities.py", line 8, in <module>
from serpent.config import config
File "/anaconda3/lib/python3.6/site-packages/SerpentAI-2018.1.2-py3.6.egg/serpent/config.py", line 18, in <module>
raise Exception("Configuration file not found at: 'config/config.yml'...")
Exception: Configuration file not found at: 'config/config.yml'...
So I think I found the problem, you can clone the GitHub repo, and it will have the config files. Then when you run pip install it will clone a version, and that version won't have the config files.
I had the same issue when trying to run serpent vi sual_debugger after following all installation guide steps.
Try to run serpent setup, it might solve the problem you have. It helped in my case.

Error starting the Jupyter notebook on Windows

When I write jupyter notebookon my on command prompt, I get an error on cmd while running jupyter. I don't understand why this is happening again and again. Therefore, it blocks to open jupyter editor in the browser. I have added all environment variables as usual, but it's not working yet. Could you please help to solve this? Any kinds of suggestions are welcome.
H:\Research\NLP\NLP Task 1>jupyter notebook
Traceback (most recent call last):
File "C:\Users\Imran\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 18, in <module>
from urllib.request import urlretrieve
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\urllib\request.py", line 88, in <module>
import http.client
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\http\client.py", line 71, in <module>
import email.parser
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\email\parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\email\feedparser.py", line 27, in <module>
from email._policybase import compat32
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\email\_policybase.py", line 9, in <module>
from email.utils import _has_surrogates
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\email\utils.py", line 29, in <module>
import socket
File "C:\Users\Imran\AppData\Local\Programs\Python\Python36-32\Lib\socket.py", line 49, in <module>
import _socket
ImportError: DLL load failed: %1 is not a valid Win32 application.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Imran\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
from notebook.notebookapp import main
File "C:\Users\Imran\Anaconda3\lib\site-packages\notebook\__init__.py", line 25, in <module>
from .nbextensions import install_nbextension
File "C:\Users\Imran\Anaconda3\lib\site-packages\notebook\nbextensions.py", line 20, in <module>
from urlparse import urlparse
ModuleNotFoundError: No module named 'urlparse'
I uninstall python and anaconda. Then i reinstall it again. And it works again.

OPENSSL_1.0.1 Error When Executing Job Inside Jenkins

I've written a python script using scrapy to crawl a site, and I'm trying to set up a job through jenkins to call the script nightly (this way it's very easy to see the output).
The machine I'm running jenkins on is a bitnami VM inside google compute.
I set up the command to run through the shell command in jenkins, and it's failing with the following error:
Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/Scrape and Import myco/workspace [workspace] $ /bin/sh -xe /opt/bitnami/apache-tomcat/temp/hudson4165433582945317339.sh
+ /usr/local/myco/myscript.py -l /usr/local/myco/results/7.log -o /usr/local/myco/results/7.json -s /usr/local/myco/results/7.stats myspider
Traceback (most recent call last): File "/usr/local/myco/myscript.py", line 5, in <module>
from twisted.internet import reactor File "/usr/local/lib/python2.7/dist-packages/twisted/internet/reactor.py", line 38, in <module>
from twisted.internet import default File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py", line 56, in <module>
install = _getInstallFunction(platform) File "/usr/local/lib/python2.7/dist-packages/twisted/internet/default.py", line 44, in _getInstallFunction
from twisted.internet.epollreactor import install File "/usr/local/lib/python2.7/dist-packages/twisted/internet/epollreactor.py", line 24, in <module>
from twisted.internet import posixbase File "/usr/local/lib/python2.7/dist-packages/twisted/internet/posixbase.py", line 23, in <module>
from twisted.internet import error, udp, tcp File "/usr/local/lib/python2.7/dist-packages/twisted/internet/tcp.py", line 29, in <module>
from twisted.internet._newtls import ( File "/usr/local/lib/python2.7/dist-packages/twisted/internet/_newtls.py", line 21, in <module>
from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol File "/usr/local/lib/python2.7/dist-packages/twisted/protocols/tls.py", line 41, in <module>
from OpenSSL.SSL import Error, ZeroReturnError, WantReadError File "/usr/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL File "/usr/local/lib/python2.7/dist-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import ( File "/usr/local/lib/python2.7/dist-packages/OpenSSL/_util.py", line 7, in <module>
binding = Binding() File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 114, in __init__
self._ensure_ffi_initialized() File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py", line 126, in _ensure_ffi_initialized
cls._modules, File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/bindings/utils.py", line 31, in load_library_for_binding
lib = ffi.verifier.load_library() File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 97, in load_library
return self._load_library() File "/usr/local/lib/python2.7/dist-packages/cffi/verifier.py", line 207, in _load_library
return self._vengine.load_library() File "/usr/local/lib/python2.7/dist-packages/cffi/vengine_cpy.py", line 155, in load_library
raise ffiplatform.VerificationError(error) cffi.ffiplatform.VerificationError: importing '/usr/local/lib/python2.7/dist-packages/cryptography/_Cryptography_cffi_e7d09016xc302a38b.so': /usr/local/lib/python2.7/dist-packages/cryptography/_Cryptography_cffi_e7d09016xc302a38b.so: symbol EC_GFp_nistp521_method, version OPENSSL_1.0.1 not defined in file libcrypto.so.1.0.0 with link time reference Build step 'Execute shell' marked build as failure Finished: FAILURE
I'm perplexed because when I run the same command (as my user and the user jenkins is running under, tomcat) I don't get this error, the script works fine.
I suspect this may have to do with the script being executed inside apache, but I'm at my wits end and googling hasn't turned up any obvious solutions.
Any idea as to how to solve this?
symbol EC_GFp_nistp521_method, version OPENSSL_1.0.1 not defined in file libcrypto.so.1.0.0
It looks like you are running a python compiled with OpenSSL 1.0.1 with a libcrypto from OpenSSL 1.0.0. It might be because you are running with a different python (at least compiled against a different OpenSSL version) but include files from your local python installation which expects the newer OpenSSL.

Unable to run Windmill, multiple errors

I have been having all kinds of problems getting Windmill setup and installed. I thought I finally got it setup, but now when I try to just run windmill, I get the following errors. Any help is appreciated.
c:\Python33\Scripts>windmill firefox http://www.google.com Traceback
(most recent call last): File
"c:\Python33\Scripts\windmill-script.py", line 9, in
load_entry_point('windmill==1.6', 'console_scripts', 'windmill')() File
"C:\Python33\lib\site-packages\distribute-0.6.49-py3.3.egg\pkg_resources.
py", line 345, in load_entry_point
return get_distribution(dist).load_entry_point(group, name) File "C:\Python33\lib\site-packages\distribute-0.6.49-py3.3.egg\pkg_resources.
py", line 2382, in load_entry_point
return ep.load() File "C:\Python33\lib\site-packages\distribute-0.6.49-py3.3.egg\pkg_resources.
py", line 2088, in load
entry = import(self.module_name, globals(),globals(), ['name']) File
"C:\Python33\lib\site-packages\windmill-1.6-py3.3.egg\windmill__init__.p
y", line 17, in
import bin, browser, server, conf, tools, sys ImportError: No module named 'bin'
I had the same issue; Windmill doesn't work with Python 3.x. To fix the problem install Python 2.x

Resources