repo fail to init on Ubuntu 16,0 virtual box on Macbook - linux

I am trying to build AOSP image on my mac Book using Linux virtual box.
Since I don't have enough space on Mac I am trying to checkoutAOSP on external 2 TB Segate HDD which I planned to use for build.
I have installed repo tool and python 2.7 but when I try to init repo with this command
repo init -u https://android.googlesource.com/platform/manifest
It fail with this error message
hitesh#hitesh-VirtualBox:/media/hitesh/2TB/test$ repo init -u https://android.googlesource.com/platform/manifest
Get https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "/media/hitesh/2TB/test/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/media/hitesh/2TB/test/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/media/hitesh/2TB/test/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/media/hitesh/2TB/test/.repo/repo/subcmds/init.py", line 399, in Execute
self._SyncManifest(opt)
File "/media/hitesh/2TB/test/.repo/repo/subcmds/init.py", line 171, in _SyncManifest
m._InitGitDir(mirror_git=mirrored_manifest_git)
File "/media/hitesh/2TB/test/.repo/repo/project.py", line 2292, in _InitGitDir
self._UpdateHooks()
File "/media/hitesh/2TB/test/.repo/repo/project.py", line 2312, in _UpdateHooks
self._InitHooks()
File "/media/hitesh/2TB/test/.repo/repo/project.py", line 2341, in _InitHooks
os.symlink(os.path.relpath(stock_hook, os.path.dirname(dst)), dst)
OSError: [Errno 38] Function not implemented
I dont know how to trouble shoot this, I dont understand which function is not implemented,

The repo needs python2, you can first check your python version of Linux is python2 not python3.

I figured it out repo cant be initialise on an external hdd. I had to create a vdi file on my external hard disk and then use that to download aosp source code.

Related

OSError: [Errno 30] Read-only file system: '/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/docs' on intel dev cloud

I am unable to install packages in my intel dev cloud. I tried installing packages using pip from bash shell. I also created a new conda environment and tried installing packages there. It didn't work either. I think the problem is with permissions in file system. The error says "read-only file system" as you can see.
Any suggestions can greatly help.
P.S: I am trying to install keras and sklearn
please check the error log below.
Installing collected packages: keras
Exception:
Traceback (most recent call last):
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '/glob/intel-python/versions/2018u2/intelpython3/lib/python3.6/site-packages/docs'
I think the problem is with permissions in file system. The error says "read-only file system"
Yes, you correctly diagnosed the problem.
You need to choose a writable filesystem to write the installed files to.
You may find the df and mount commands helpful. Start with man df.
With the guidance of #J_H I found out the answer.
pip usually tries to install packages globally, which is not allowed on shared platforms like Intel DevCloud. Hence we need to install packages for single user that is you.
Hence
pip install --user keras
installs keras in your home directory and you are not restricted to write in your home directory. Problem Solved!

gdbm error 22 when performing Python shelve open

Doing a simple shelve.open will give the following error:
>>> shelve.open('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/shelve.py", line 243, in open
return DbfilenameShelf(filename, flag, protocol, writeback)
File "/usr/lib/python3.6/shelve.py", line 227, in __init__
Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)
File "/usr/lib/python3.6/dbm/__init__.py", line 94, in open
return mod.open(file, flag, mode)
_gdbm.error: [Errno 22] Invalid argument
I've only come across one related search result to this issue: https://github.com/pydanny/cookiecutter-django/issues/1793#issuecomment-440406112
I got exactly the same error on a Vagrant dev environment. Celery uses dbm for persistent storage, which is built on top of the gdbm C library. Some testing has revealed that this works when creating or opening files on a native filesystem but not on a mounted filesystem.
I'm running this under a Vagrant Ubuntu box in MacOS so it makes sense. I have also run the same box under Windows 10 and this issue doesn't crop up. Any clues for a fix?
I had the same issue and couldn't find any help online until I came across this post
https://github.com/we45/ThreatPlaybook/issues/11
creating a new virtual environment worked for me

Pyinstaller does not look for the file inside the Python Virtual Environment

I want to convert Python code into standalone executable , the code uses numpy, scipy, and Pymc3 modules. I am using Python 3.6.4. I have created the project using Virtual Environment in Pycharm IDE. The command that I used to run pyinstaller is as follows:
venv/Scripts/pyinstaller --onefile src/POD.py
venv being the folder where virtual environment is stored and src being the folder where my Python source code ie. POD.py is saved. Pyinstaller runs just fine generates some warning message, but when I try to run the executable generated by pyinstaller it thrown as error
Traceback (most recent call last):
File "POD.py", line 196, in <module>
File "POD.py", line 79, in train
File "Lib\site-packages\theano\tensor\var.py", line 155, in __mul__
File "Lib\site-packages\theano\gof\op.py", line 615, in __call__
File "Lib\site-packages\theano\tensor\elemwise.py", line 482, in make_node
File "Lib\site-packages\theano\tensor\elemwise.py", line 438, in get_output_info
File "Lib\site-packages\theano\tensor\elemwise.py", line 157, in __init__
File "Lib\site-packages\theano\gof\op.py", line 1308, in __init__
File "Lib\site-packages\theano\gof\op.py", line 1331, in load_c_code
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\AppData\\Local\\Temp\\_MEI126642\\theano\\tensor\\c_code\\dimshuffle.c'
[4756] Failed to execute script POD
Seems like it is trying to find the file dimshuffle.c outside of the virtual environment. In-fact the I can see that there is folder inside virtual environment which has the dim_shuffle.c code. I can find it inside virtual environment in following folder.
venv/Lib/site-packages/theano/tensor/c_code/dimshuffle,c
My question is how do I instruct pyinstaller to look for dimshuffle inside virtual environment folder?
You can,
extend the sys.path by editing the spec file.
pyi-makespec --paths=/path/to/thisdir \
--paths=/path/to/otherdir myscript.py
List the hidden imports using the spec file.
for more info refer this

[ Python 2.7 ]Package program with Pynsist

I am packaging a Python 2.7 program with the lastest version of Pynsist.
I've created an installer.cfg file following this example.
But when I try to package my application running
pynsist installer.cgf
into the application folder it comes up with
Copying Python installer to build directory
PyLauncher MSI already in build directory.
Copying packages into build directory...
Traceback (most recent call last):
File "/usr/local/bin/pynsist", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/nsist/__init__.py", line 540, in main
InstallerBuilder(**args).run(makensis=(not options.no_makensis))
File "/usr/local/lib/python2.7/dist-packages/nsist/__init__.py", line 495, in run
self.prepare_packages()
File "/usr/local/lib/python2.7/dist-packages/nsist/__init__.py", line 381, in prepare_packages
py_version=self.py_version, exclude=self.exclude)
File "/usr/local/lib/python2.7/dist-packages/nsist/copymodules.py", line 224, in copy_modules
mc.copy(modname, target, exclude)
File "/usr/local/lib/python2.7/dist-packages/nsist/copymodules.py", line 195, in copy
check_package_for_ext_mods(path, self.py_version)
File "/usr/local/lib/python2.7/dist-packages/nsist/copymodules.py", line 41, in check_package_for_ext_mods
check_ext_mod(os.path.join(path, dirpath, filename), target_python)
File "/usr/local/lib/python2.7/dist-packages/nsist/copymodules.py", line 30, in check_ext_mod
raise ExtensionModuleMismatch(extensionmod_errmsg % ('Windows', path))
nsist.copymodules.ExtensionModuleMismatch: Found an extension module that will not be usable on Windows:
/usr/lib/python2.7/dist-packages/pygame/rwobject.so
Put Windows packages in pynsist_pkgs/ to avoid this.
So the problem I think is with Pygame.
On Google there in nothing about this, but i cannot use others programs for packaging(eg. py2exe, pyinstaller ecc...).
Thanks and sorry for the bad english
Reposting as an answer, since it worked:
If you put pygame in packages=, it tries to copy it from your computer. But on your computer that's pygame for Linux, which won't work on Windows. If you instead put pygame in the pypi_wheels= bit of the config file, Pynsist will take care of downloading a Windows version for you.
Have a look at the pygame example in the Pynsist repository.
Most packages don't have this problem because they only contain Python code, which is the same files on all platforms. Pygame has compiled modules, which have to be compiled for the right platform.

install issue with python - spacy package in anaconda environment

I'm attempting to follow this tutorial to install the natural language processing package spaCy into a python 3 anaconda environment, windows 8
I opened console, cd-ed to my site-packages folder, activated environment, pip-ed for install, everything seemed fine except I couldn't run the second command here
$ pip install spacy
$ python -m spacy.en.download
Now I can successfully load the package but when I run the second line below, I get the following error
>>> from spacy.en import English #this works
>>> nlp = English() #this doesn't
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\garrett\Anaconda\envs\py3k\lib\site-packages\spacy\en\__init__.py", line 64, in __init__
get_lex_props=get_lex_props)
File "spacy/vocab.pyx", line 42, in spacy.vocab.Vocab.__init__ (spacy/vocab.cpp:2216)
OSError: Directory C:\Users\garrett\Anaconda\envs\py3k\lib\site-packages\spacy\en\data\vocab not found -- cannot load Vocab.
I think that it is due to the fact that I couldn't run python -m spacy.en.download
Can anyone give me an idea of what python -m spacy.en.download is supposed to be doing?
Can anyone provide a walkthrough for how to get spaCy installed in an anaconda environment?
here's the error I get after setting the directory, activating python env, running command. The first several times I tried, my spyder editor went unresponsive and I killed the console, the most recent time I got this error
$ cd C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages
$ C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages>activate py3k
$ [py3k] C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages>python -m spacy.en.download
Moving existing dir C:\Users\garrett\Anaconda\envs\py3k\Lib\site-packages\spacy\en\data to /tmp
Traceback (most recent call last):
File "C:\Users\garrett\Anaconda\envs\py3k\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Users\garrett\Anaconda\envs\py3k\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
File ".\spacy\en\download.py", line 56, in <module>
plac.call(main)
File ".\plac_core.py", line 309, in call
cmd, result = parser_from(obj).consume(arglist)
File ".\plac_core.py", line 195, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File ".\spacy\en\download.py", line 51, in main
shutil.move(DEST_DIR, '/tmp')
File "C:\Users\garrett\Anaconda\envs\py3k\lib\shutil.py", line 521, in move
raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path '/tmp\data' already exists
appreciate any help or advice you can provide
You have hit this bug which should be already fixed in the last version. Apparently spacy can't download the data because the destination already exists (may be from a previous interrupted download). A workaround would be to delete the /temp/data folder and retry the download.

Resources