Error when trying repo init on external drive on Ubuntu - python

I'm trying to init repo of Android ROM, but it returns following error on Ubuntu 16.04:
$ repo init -u git://github.com/AOSiP/platform_manifest.git -b pie
Get git://github.com/AOSiP/platform_manifest.git
Traceback (most recent call last):
File "/media/exthdd/AOSIP/.repo/repo/main.py", line 547, in <module>
_Main(sys.argv[1:])
File "/media/exthdd/AOSIP/.repo/repo/main.py", line 522, in _Main
result = repo._Run(argv) or 0
File "/media/exthdd/AOSIP/.repo/repo/main.py", line 184, in _Run
result = cmd.Execute(copts, cargs)
File "/media/exthdd/AOSIP/.repo/repo/subcmds/init.py", line 426, in Execute
self._SyncManifest(opt)
File "/media/exthdd/AOSIP/.repo/repo/subcmds/init.py", line 188, in _SyncManifest
m._InitGitDir(mirror_git=mirrored_manifest_git)
File "/media/exthdd/AOSIP/.repo/repo/project.py", line 2395, in _InitGitDir
self._UpdateHooks()
File "/media/exthdd/AOSIP/.repo/repo/project.py", line 2416, in _UpdateHooks
self._InitHooks()
File "/media/exthdd/AOSIP/.repo/repo/project.py", line 2446, in _InitHooks
os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
File "/media/exthdd/AOSIP/.repo/repo/platform_utils.py", line 195, in symlink
return os.symlink(source, link_name)
OSError: [Errno 38] Function not implemented
It works when running on system drive, but I don't have enough space there.

Drive had exFAT filesystem, error gone on ext4.

Related

Cannot launch Anaconda-Navigator under Ubuntu system with error FileNotFound

I launch terminal and run anaconda-navigator I can see the green icon, however forever paused with the following details in the terminal
Traceback (most recent call last):
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/widgets/main_window.py", line 550, in setup
self.post_setup(conda_data=conda_data)
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/widgets/main_window.py", line 587, in post_setup
self.tab_home.setup(conda_data)
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/widgets/tabs/home.py", line 171, in setup
self.set_applications(applications, packages)
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/widgets/tabs/home.py", line 206, in set_applications
apps = self.api.process_apps(applications, prefix=self.current_prefix)
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/anaconda_api.py", line 865, in process_apps
app = app(config=self.config, process_api=self._process_api)
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/external_apps/pycharm.py", line 111, in __init__
super(PyCharmProApp, self).__init__(
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/external_apps/pycharm.py", line 15, in __init__
super(BasePyCharmApp, self).__init__(
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/external_apps/base.py", line 47, in __init__
self.set_up_app_directory_path()
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/external_apps/base.py", line 59, in set_up_app_directory_path
self.app_directory_path = self._get_linux_installation_directory()
File "/home/jichao/anaconda3/lib/python3.8/site-packages/anaconda_navigator/api/external_apps/pycharm.py", line 62, in _get_linux_installation_directory
for dir_name in os.listdir(root):
FileNotFoundError: [Errno 2] No such file or directory: '/opt'
I checked to see if the opt folder was in the root directory. It was not. I opened terminal and typed:
cd /
sudo makedir opt
This appeared to solve the issue for me.

coudn't find location of python module

I'm working with ubuntu, and it gives following error
Traceback (most recent call last):
File "SMAPylModules/SMAPylDriverPy.m/src/licensing.py", line 559, in <module>
File "SMAPylModules/SMAPylDriverPy.m/src/application.py", line 151, in run
File "SMAPylModules/SMAPylDriverPy.m/src/licensing.py", line 155, in execute
File "SMAPylModules/SMAPylDriverPy.m/src/licensing.py", line 228, in runCurrentUsageApp
File "SMAPyrModules/SMAPyrUtiPy.m/src/uti.py", line 37, in spawnAndWait
File "SMAPyrModules/SMAPyrUtiPy.m/src/utiSpawn.py", line 93, in spawnAndWait
File "SMAPyrModules/SMAPyrUtiPy.m/src/utiSpawnImpl.py", line 643, in spawnAndWait
File "SMAPyrModules/SMAPyrUtiPy.m/src/utiSpawnImpl.py", line 477, in __init__
File "SMAPyrModules/SMAPyrUtiPy.m/src/utiSpawnImpl.py", line 438, in popenWrap
I cannot find the SMAPyModules directory as well as modules such as licensing.py, utiSpawn.py etc.
Could you give me some solution or advice?
In the console:
sudo apt install lsb

How do I use the 'keyboard' python module in a docker container without an error?

I am trying to use the python module keyboard in a docker container for testing automation that emulates keyboard presses. However, this module continually returns an error in the docker container whereas it works fine in an ubuntu VM.
I have installed different commonly used docker containers and different versions of python. I get the same error. Sadly, google hasn't been as helpful as it usually is here.
Here's an easily reproducible version of what I've done:
docker run -t -d -u root --name docker_container python:3.7
echo $(docker exec -u root docker_container bash -c 'python3 -m keyboard' )
This returns the below error message:
/usr/local/lib/python3.7/site-packages/keyboard/_nixkeyboard.py:110: UserWarning: Failed to create a device file using `uinput` module. Sending of events may be limited or unavailable depending on plugged-in devices.
device = aggregate_devices('kbd')
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.7/site-packages/keyboard/_nixcommon.py", line 106, in start_reading
self.event_queue.put(device.read_event())
File "/usr/local/lib/python3.7/site-packages/keyboard/_nixcommon.py", line 83, in read_event
data = self.input_file.read(struct.calcsize(event_bin_format))
AttributeError: 'NoneType' object has no attribute 'read'
Exception in thread Thread-2:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/threading.py", line 926, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.7/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.7/site-packages/keyboard/_nixcommon.py", line 106, in start_reading
self.event_queue.put(device.read_event())
File "/usr/local/lib/python3.7/site-packages/keyboard/_nixcommon.py", line 83, in read_event
data = self.input_file.read(struct.calcsize(event_bin_format))
AttributeError: 'NoneType' object has no attribute 'read'
Traceback (most recent call last):
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.7/site-packages/keyboard/__main__.py", line 10, in <module>
keyboard.hook(print_event_json)
File "/usr/local/lib/python3.7/site-packages/keyboard/__init__.py", line 459, in hook
append(callback)
File "/usr/local/lib/python3.7/site-packages/keyboard/_generic.py", line 67, in add_handler
self.start_if_necessary()
File "/usr/local/lib/python3.7/site-packages/keyboard/_generic.py", line 35, in start_if_necessary
self.init()
File "/usr/local/lib/python3.7/site-packages/keyboard/__init__.py", line 194, in init
_os_keyboard.init()
File "/usr/local/lib/python3.7/site-packages/keyboard/_nixkeyboard.py", line 114, in init
build_tables()
File "/usr/local/lib/python3.7/site-packages/keyboard/_nixkeyboard.py", line 73, in build_tables
dump = check_output(['dumpkeys', '--keys-only'], universal_newlines=True)
File "/usr/local/lib/python3.7/subprocess.py", line 395, in check_output
**kwargs).stdout
File "/usr/local/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/local/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/local/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dumpkeys': 'dumpkeys'
From what I understand, it can't access a uinput device / keyboard to be able to dump the keys. Is there a way to virtually simulate a keyboard in the container to allow this to work?
try to install the following:
apt-get install -y kmod kbd
since you need this to get dumpkeys

PRAW induced SSL error when compiling Python script using py2exe

Python 2.7.11
Requests 2.9.1
Praw 3.4.0
I have a python script that uses PRAW (reddit API wrapper), I'm attempting to compile it into an .exe using py2exe.
Here is the current error that occurs when the .exe is run:
Traceback (most recent call last):
File "MYSCRIPTNAME.py", line 263, in <module>
File "<decorator-gen-51>", line 2, in login
File "praw\decorators.pyc", line 78, in wrap
File "praw\__init__.pyc", line 1455, in login
File "<decorator-gen-8>", line 2, in request_json
File "praw\decorators.pyc", line 116, in raise_api_exceptions
File "praw\__init__.pyc", line 620, in request_json
File "praw\__init__.pyc", line 451, in _request
File "praw\__init__.pyc", line 432, in handle_redirect
File "praw\handlers.pyc", line 146, in wrapped
File "praw\handlers.pyc", line 56, in wrapped
File "praw\handlers.pyc", line 102, in request
File "requests\sessions.pyc", line 576, in send
File "requests\adapters.pyc", line 447, in send
requests.exceptions.SSLError: [Errno 2] No such file or directory
Line 263 is r.login(user,pw) (r is r = praw.Reddit(userAgent))
Searching for other SSL issues on here and other places discussed adding cacert.pem. I tried this without resolution.

Google AppEngine Python OSError "too many files open" at launch

I'm using ubuntu 13.10 running in a VM on OSX, python2.7 and GAE 1.8.8.
Lauching dev_appserver.py results in the following error:
INFO 2013-12-10 03:53:30,046 api_server.py:527] Saving search indexes
Traceback (most recent call last):
File "/home/ubuntu/xxxxxx/google_appengine/dev_appserver.py", line 197, in <module>
File "/home/ubuntu/xxxxxx/google_appengine/dev_appserver.py", line 193, in _run_file
File "/home/ubuntu/xxxxxx/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 872, in <module>
File "/home/ubuntu/xxxxxx/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 868, in main
File "/home/ubuntu/xxxxxx/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 707, in stop
File "/home/ubuntu/xxxxxx/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 141, in quit
File "/home/ubuntu/xxxxxx/google_appengine/google/appengine/tools/devappserver2/api_server.py", line 528, in cleanup_stubs
File "/home/ubuntu/xxxxxx/google_appengine/google/appengine/api/search/simple_search_stub.py", line 984, in Write
File "/usr/lib/python2.7/tempfile.py", line 304, in mkstemp
File "/usr/lib/python2.7/tempfile.py", line 239, in _mkstemp_inner
OSError: [Errno 24] Too many open files: '/tmp/appengine.xxxxxx-hr-dev.ubuntu/tmpMVVXrH'
Any ideas?
Check the shared memory parameter, kern.sysv.shmseg on your linux system and set it right by increasing it.
To view the shared memory parameters, use:
sysctl -A | grep shm
To update that parameters, edit file:
sudo nano /etc/sysctl.conf
Refer to this SO answer for more information.

Categories

Resources