I'm trying to use a piece of software (Quillpad) which won't compile due to:
File "startquill_cherry.py", line 31, in <module>
logging.config.fileConfig('logsystem.conf')
File "/usr/lib/python2.7/logging/config.py", line 85, in fileConfig
handlers = _install_handlers(cp, formatters)
File "/usr/lib/python2.7/logging/config.py", line 163, in _install_handlers
h = klass(*args)
File "/usr/lib/python2.7/logging/__init__.py", line 913, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib/python2.7/logging/__init__.py", line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 2] No such file or directory: 'mydir/logs/root.log'
This error is triggered by the following code in the startquill_cherry.py file:
logging.config.fileConfig('logsystem.conf')
logger = logging.getLogger('quillpad')
The relevant code in logsystem.conf (I think) is the following:
[loggers]
keys=root,datacollector,mailcollector
[logger_root]
level=INFO
handlers=default
[handler_default]
class=FileHandler
level=INFO
formatter=default
args=('logs/quill.log', 'a')
Any thoughts on this? I don't really understand how the config files in Python 2.7 work here. I was able to make the program compile by commenting out the Python code, but eventually it causes another error.
Related
I am getting an error when there are too many requests coming to my application. Previously we did not notice so much issues, but recently we have seen that we get the error:
BlockingIOError: [Errno 11] write could not complete without blocking
print(ServDHCPRelay,"ServDHCPRelay")
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 41, in write
self.__convertor.write(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 162, in write
self.write_and_convert(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 190, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 195, in write_plain_text
self.wrapped.write(text[start:end])
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 41, in write
self.__convertor.write(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 162, in write
self.write_and_convert(text)
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 190, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "/apps/netadc3/.venvs3/netadc3.8/lib64/python3.8/site-packages/colorama/ansitowin32.py", line 196, in write_plain_text
self.wrapped.flush()
BlockingIOError: [Errno 11] write could not complete without blocking
The error happens on print statements.
We upgraded from python3.6 -> rh-python3.8 recently and we are using django 3.2!
uWSGI version 2.0.20
My application works properly on the local machine. However, as I uploaded the application to elastic beanstalk, the import of librosa library broke the application. How to solve the issue?
import os
import pandas as pd
import librosa
import numpy as np
from sklearn.preprocessing import StandardScaler
# split training and test data
from sklearn.model_selection import train_test_split
from flask import Flask
from flask import request
from flask import Response
# EB looks for an 'application' callable by default.
application = Flask(__name__)
#application.route('/', methods=['Get'])
def homepage():
return "Hello World"
# run the app.
if __name__ == "__main__":
# Setting debug to True enables debug output. This line should be
# removed before deploying a production app.
application.debug = True
application.run()
I am using Python 3.8 on Amazon linux 2. The packages are installed using requirements.txt :
flask==1.1.2
flask_cors==3.0.10
imageio==2.9.0
librosa==0.8.1
moviepy==1.0.3
numpy==1.19.0
pandas==1.2.3
scikit-learn==0.24.1
tensorflow==2.2.0
werkzeug==1.0.1
The log is given below:
2022/02/11 20:22:31.051794 [ERROR] An error occurred during execution of command [app-deploy] - [InstallDependency]. Stop running the command. Error: fail to install dependencies with requirements.txt file with error Command /bin/sh -c /var/app/venv/staging-LQM1lest/bin/pip install -r requirements.txt failed with error exit status 2. Stderr:ERROR: Exception:
Traceback (most recent call last):
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 164, in exc_logging_wrapper
status = run_func(*args)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 205, in wrapper
return func(self, options, args)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 339, in run
reqs, check_supported_wheels=not options.target_dir
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 93, in resolve
collected.requirements, max_rounds=try_to_avoid_resolution_too_deep
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 482, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 349, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/resolvelib/structs.py", line 151, in __bool__
return bool(self._sequence)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 155, in __bool__
return any(self)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 143, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 47, in _iter_built
candidate = func()
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 206, in _make_candidate_from_link
version=version,
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 287, in __init__
version=version,
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 156, in __init__
self.dist = self._prepare()
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 225, in _prepare
dist = self._prepare_distribution()
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 292, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 482, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 528, in _prepare_linked_requirement
link, req.source_dir, self._download, self.download_dir, hashes
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 217, in unpack_url
hashes=hashes,
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 94, in get_http_url
from_path, content_type = download(link, temp_dir.path)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/network/download.py", line 145, in __call__
for chunk in chunks:
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/cli/progress_bars.py", line 144, in iter
for x in it:
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_internal/network/utils.py", line 87, in response_chunks
decode_content=False,
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/urllib3/response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 65, in read
self._close()
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 52, in _close
self.__callback(self.__buf.getvalue())
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 309, in cache_response
cache_url, self.serializer.dumps(request, response, body=body)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 72, in dumps
return b",".join([b"cc=4", msgpack.dumps(data, use_bin_type=True)])
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/__init__.py", line 35, in packb
return Packer(**kwargs).pack(o)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 960, in pack
self._pack(obj)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 944, in _pack
len(obj), dict_iteritems(obj), nest_limit - 1
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 1045, in _pack_map_pairs
self._pack(v, nest_limit - 1)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 944, in _pack
len(obj), dict_iteritems(obj), nest_limit - 1
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 1045, in _pack_map_pairs
self._pack(v, nest_limit - 1)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/pip/_vendor/msgpack/fallback.py", line 889, in _pack
return self._buffer.write(obj)
Can anyone please confirm if the application works on EB?
The issue is probably with tensorflow==2.2.0. This is a very heavy library and you can't install it on t2.micro. You need at least t2.medium (not in free tier) which has more RAM to successfully install tensorflow==2.2.0 on EB.
I am having challenges logging to my compute engine instance,
serial console is giving me the following log.
File "/usr/bin/supervisord", line 11, in <module>
load_entry_point('supervisor==3.3.1', 'console_scripts', 'supervisord')()
File "/usr/lib/python2.7/dist-packages/supervisor/supervisord.py", line 357, in main
options = ServerOptions()
File "/usr/lib/python2.7/dist-packages/supervisor/options.py", line 438, in __init__
existing_directory, default=tempfile.gettempdir())
File "/usr/lib/python2.7/tempfile.py", line 275, in gettempdir
tempdir = _get_default_tempdir()
File "/usr/lib/python2.7/tempfile.py", line 217, in _get_default_tempdir
("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/'
I'm trying to run my python code and it shows the following:
IOError: [Errno socket error] [Errno 54] Connection reset by peer
Here is my code:
import urllib
def dl_jpg(url, file_path, file_name):
full_path = file_path + file_name + '.jpg'
urllib.urlretrieve(url, full_path)
url = 'https://xxxxx'
file_name = '1'
dl_jpg(url, 'image/', file_name)
It works fine before but doesn't work now. I'm not sure about the cause, the only difference I can think of is I updated my macOS. I am new to coding and still very confused after googled. I guess there are some issues in the ssl.
I now have
macOS 10.14.3
LibreSSL 2.6.5
Python 2.7.10
Any idea? Thank you so much!
Traceback (most recent call last):
File "img3.py", line 10, in <module>
dl_jpg(url, 'image3/', file_name)
File "img3.py", line 5, in dl_jpg
urllib.urlretrieve(url, full_path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 98, in urlretrieve
return opener.retrieve(url, filename, reporthook, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 245, in retrieve
fp = self.open(url, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 213, in open
return getattr(self, name)(url)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib.py", line 443, in open_https
h.endheaders(data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders
self._send_output(message_body)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output
self.send(msg)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send
self.connect()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect
server_hostname=server_hostname)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket
_context=self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__
self.do_handshake()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake
self._sslobj.do_handshake()
Unfortunately, this is a known issue with python 2.7.10 which comes pre-installed with Mac OS. If you can upgrade your version of python and use it to run your script, you will find that it will work again.
when i run storm nimbus or other storm command i get the same error
~/work/apache-storm-0.9.5/bin$ storm nimbus
Traceback (most recent call last): File "/home/libin/work/apache-storm-0.9.5/bin/storm", line 514, in <module>
main()
File "/home/libin/work/apache-storm-0.9.5/bin/storm", line 511, in main
(COMMANDS.get(COMMAND, unknown_command))(*ARGS)
File "/home/libin/work/apache-storm-0.9.5/bin/storm", line 308, in nimbus
jvmopts = parse_args(confvalue("nimbus.childopts", cppaths)) + [
File "/home/libin/work/apache-storm-0.9.5/bin/storm", line 113, in confvalue
p = sub.Popen(command, stdout=sub.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
edit: i modify my javahome as #helloV said,but get the same mistake
Check your JAVA_HOME. I had the same issue. My JAVA_HOME was pointing to a wrong dir. Once I set JAVA_HOME correctly, the problem went away.
echo $JAVA_HOME
> /usr/lib/jvm/jdk1.7.0_17