As I have very little knowledge about Linux, pretty much all I can do is copy and paste things from a good tutorial and in most cases simply hope nothing goes wrong. I really tried finding a solution on my own and searching the internet but to no avail (I found a number of quite similar things but no solution I understood enough to be able to adapt it on my own to fix my problem).
I've installed an osm tile server using this amazing tutorial and it works like a charm. Now I want to install umap, using this tutorial.
Everything works fine until I get to the line "umap collectstatic". The error I get is this:
(venv) $ sudo umap collectstatic
[sudo] Passwort für umap2:
You have requested to collect static files at the destination
location as specified in your settings:
/home/ybon/.virtualenvs/umap/var/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "/usr/local/bin/umap", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/umap/bin/__init__.py", line 12, in main
management.execute_from_command_line()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 367, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 359, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 294, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 345, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 193, in handle
collected = self.collect()
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 115, in collect
for path, storage in finder.list(self.ignore_patterns):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/finders.py", line 112, in list
for path in utils.get_files(storage, ignore_patterns):
File "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/utils.py", line 28, in get_files
directories, files = storage.listdir(location)
File "/usr/local/lib/python2.7/dist-packages/django/core/files/storage.py", line 399, in listdir
for entry in os.listdir(path):
OSError: [Errno 2] No such file or directory: '/home/ybon/Code/js/Leaflet.Storage'
Now, I get the something might be wrong with a setting in a config file somewhere, but changing the directory in local.py
doesn't seem to do anything (like I have set it to STATIC_ROOT = '/home/xxx_myusername_xxx/umap/var/static') - I have no idea where this "/home/ybon/Code/..." path even comes from! What settings ?
I sure didn't specify THIS path anywhere! And the folder is indeed nowhere to be found on my machine. Maybe using virtualenv is somehow generating it, and I can't find it on my machine because it IS virtual (as in "not really there physically") but this is just a very wild guess and I don't really know what I'm talking about.
(I tried running the command with and without sudo and it doesn't change anything).
I have always wanted to install a tile server and have tried the tutorials you have given today. So I'm a learner like you!
Installing the Tile Server with the tutorial https://www.linuxbabe.com/linux-server/openstreetmap-tile-server-ubuntu-16-04 was really straightforward. I only used the part for Rhineland Palatinate.
With Umap (https://umap-project.readthedocs.io/en/latest/ubuntu/#tutorial) I had some problems.
1. A port was used twice. I changed the port for Apache.
2. After creating the local configuration (wget https://raw.githubusercontent.com/umap-project/umap/master/umap/settings/local.py.sample -O /etc/umap/umap.conf) this file was not immediately recognized. I helped myself by changing the file before executing the command "umap migrate".
I have made the following changes:
# For static deployment
STATIC_ROOT = '/etc/umap/var/static'
# For users' statics (geojson mainly)
MEDIA_ROOT = '/etc/umap/umap/var/data'
# Umap Settings
UMAP_SETTINGS='/etc/umap/umap.conf'
STATIC_ROOT und MEDIA_ROOT I have changed, because so the user umap has all permissions. Then I set the envirement variable UMAP_SETTINGS because otherwise the settings file /etc/umap/umap.conf is not found.
( I also have no idea where this "/home/ybon/Code/..." path comes from. After the configuration file is properly loaded, the path is loaded from the configuration file. That's why that's not important anymore. )
Now I could use the following commands without errors:
(venv) $ umap collectstatic
Loaded local config from /etc/umap/umap.conf
You have requested to collect static files at the destination
location as specified in your settings:
/etc/umap/var/static
This will overwrite existing files!
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Copying '/srv/umap/venv/lib/python3.5/site-packages/umap/static/favicon.ico'
...
290 static files copied to '/etc/umap/var/static'.
(venv) $ umap storagei18n
Loaded local config from /etc/umap/umap.conf
Processing English
Found file /etc/umap/var/static/storage/src/locale/en.json
Exporting to /etc/umap/var/static/storage/src/locale/en.js
..
Processing Deutsch
Found file /etc/umap/var/static/storage/src/locale/de.json
..
Found file /etc/umap/var/static/storage/src/locale/sk_SK.json
Exporting to /etc/umap/var/static/storage/src/locale/sk_SK.js
(venv) $ umap createsuperuser
Loaded local config from /etc/umap/umap.conf
Username (leave blank to use 'umap'):
Email address:
Password:
Password (again):
Superuser created successfully.
(venv) $ umap runserver 0.0.0.0:8000
Loaded local config from /etc/umap/umap.conf
Loaded local config from /etc/umap/umap.conf
Performing system checks...
System check identified no issues (0 silenced).
April 09, 2018 - 14:02:15
Django version 1.10.5, using settings 'umap.settings'
Starting development server at http://0.0.0.0:8000/
And finally I was able to use umap.
Related
I am using Jupyter notebooks via anaconda. When saving a new notebook to a specific directory, the whole directory becomes inaccessible, showing this error (image and text below). Other directories and the notebooks inside them are still accessible and able to be run. I am able to save new notebooks and run them in other directories no problem.
Error:
Server error: Traceback (most recent call last): File "C:\Users\u1252652.conda\envs\DS011_loss_ratio\lib\site-packages\tornado\web.py", line 1704, in _execute result = await result File "C:\Users\u1252652.conda\envs\DS011_loss_ratio\lib\site-packages\tornado\gen.py", line 234, in wrapper yielded = ctx_run(next, result) File "C:\Users\u1252652.conda\envs\DS011_loss_ratio\lib\site-packages\notebook\services\contents\handlers.py", line 116, in get model = yield maybe_future(self.contents_manager.get( File "C:\Users\u1252652.conda\envs\DS011_loss_ratio\lib\site-packages\notebook\services\contents\filemanager.py", line 435, in get model = self._dir_model(path, content=content) File "C:\Users\u1252652.conda\envs\DS011_loss_ratio\lib\site-packages\notebook\services\contents\filemanager.py", line 309, in _dir_model for name in os.listdir(os_dir): OSError: [WinError 87] The parameter is incorrect: 'C:\Users\u1252652\OneDrive - MMC\Documents\DS011_loss_ratio'
This is strange as i have been working in this directory and saving numerous notebooks to it without error until today. I can delete the notebook that caused it to crash and then it returns to normal and i can run notebooks that were already saved before today.
I am unsure if this is related or not but i also have an issue whereby i have to run python -m ipykernel install --user every time i change to a new environment in anaconda, otherwise the executable remains as that of the last environment i ran that command with. Perhaps this is useful i'm not sure, if anyone had advice with this too i'd be grateful.
I have also tried making a new directory, copying over the contents of the dysfunctional directory, and then making a new notebook from there, however this causes the same error.
when i install a package in old venv,as below:
(conda_venv)my-ubuntu:~/file$: conda install random
Collecting package metadata (current_repodata.json):failed
Traceback (most recent call last):
File"/home/my/anaconda3/lib/python3.9/site-packages/conda/exceptions.py",line 1214, in print_unexpected_error_report message builder.append(get main info str(error report['conda info']))
File"/home/my/anaconda3/ib/python3.9/site-packages/conda/cli/main_info.py", line 237, in get_main_info_str
info dict[' '+ key] = ('\n’ + 26 *'').join(info dict[key])
KeyError: 'pkgs_dirs'
and
enviroment variables:
conda info could not be constucted.
KeyError('pkgs_dirs')
and when i create a new venv,it shows the same error as above.
I found someone had the same prolem like me and they used "conda config --show-sources" to resolve,and i tried,but i got nothing but a blank line.
And i also tried "conda info",it showed
File"/home/my/anaconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1082, in __call return func(*args,**kwargs)
File "/home/my/anaconda3/lib/python3.9/site-packages/conda/cli/main.py", line 87, in _main exit code = do call(args,p)
...
...
File "/home/my/anaconda3/lib/python3.9/site-packages/conda/ vendor/distro.py". line 599. in init
self. lsb release info = self. get lsb release info() \
subprocess.CalledProcessError:Command 'lsb_release -a' returned non-zero exit status 126
i don't know how to handle with this problem.I will appreciated it if any one can help.Thanks in advance!
Issues with KeyError can result from malformed configuration files. Please check your .condarc files are not corrupted (should be valid YAML). These can be located in three locations:
user home (~/.condarc)
Conda environment prefix (e.g., /home/my/anaconda3/.condarc, for OP)
working directory
It also should be noted that it appears to be looking for a key pkgs dirs rather than the standard pkgs_dirs. Perhaps someone ran a conda config --set 'pkgs dirs' '/path/to/blah' by mistake?
I installed Cassandra on Big Sur 11.4 using homebrew, and when I tried to run cqlsh, I received this error.
isaackim#Isaacs-MacBook-Pro bin % cqlsh
Traceback (most recent call last):
File "/usr/local/Cellar/cassandra/3.11.10/libexec/bin/cqlsh.py", line 2458, in <module>
main(*read_options(sys.argv[1:], os.environ))
File "/usr/local/Cellar/cassandra/3.11.10/libexec/bin/cqlsh.py", line 2232, in read_options
configs.read(CONFIG_FILE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
I previously had Anaconda3 installed, and received the same error (the only difference was the path to cqlsh.py). I thought it might be an issue with Anaconda so I uninstalled Anaconda entirely, then I reinstalled Cassandra using homebrew.
I would appreciate any and all suggestions. Thanks in advance.
Thanks to Alex Ott's suggestion, I managed to replicate the issue you posted by creating a bad ~/.cassandra/cqlshrc configuration file which only contains the following line:
username = alice
As this error suggests:
ConfigParser.MissingSectionHeaderError: File contains no section headers.
the configuration parser detected that there are no section headers in the file. Section headers are line entries enclosed in square brackets ([header_name]). For example:
[authentication]
username = alice
password = Som3Comp7exPa$$word
Review your cqlshrc and make the necessary corrections. If necessary, use the example cqlshrc.sample file in conf/. Cheers!
I tried to try a chatbot made by a friend of mine with Rasa on a Windows 10. Getting started with the installation of the backend through their tutorial I was surprised that I couldn't link model to 'en_core_web_md' after using python -m spacy link en_core_web_md en. Here is the full error message:
Error: Couldn't link model to 'en_core_web_md'
Creating a symlink in spacy/data failed. Make sure you have the required
permissions and try re-running the command as admin, or use a
virtualenv. You can still import the model as a module and call its
load() method, or create the symlink manually.
C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\en_core_web_md
-->
C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\data\en_core_web_md
Creating a shortcut link for 'en' didn't work (maybe you don't have
admin permissions?), but you can still load the model via its full
package name: nlp = spacy.load('{name}')
Download successful but linking failed
(cha_env36) C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation>
(cha_env36) C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation>python -m spacy link en_core_web_md en
Error: Couldn't link model to 'en'
Creating a symlink in spacy/data failed. Make sure you have the required
permissions and try re-running the command as admin, or use a
virtualenv. You can still import the model as a module and call its
load() method, or create the symlink manually.
C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\en_core_web_md
-->
C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\data\en
Traceback (most recent call last):
File "C:\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\__main__.py", line 31, in <module>
plac.call(commands[command], sys.argv[1:])
File "C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\plac_core.py", line 207, in consume
return cmd, self.func(*(args + varargs + extraopts), **kwargs)
File "C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\cli\link.py", line 48, in link
symlink_to(link_path, model_path)
File "C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\compat.py", line 87, in symlink_to
orig.symlink_to(dest)
File "C:\Python36\lib\pathlib.py", line 1327, in symlink_to
self._accessor.symlink(target, self, target_is_directory)
File "C:\Python36\lib\pathlib.py", line 393, in wrapped
return strfunc(str(pathobjA), str(pathobjB), *args)
OSError: symbolic link privilege not held
(cha_env36) C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation>sudo python -m spacy link en_core_web_md en
C:\Python36\python.exe: No module named spacy
It's weird because I was able to do so on Ubuntu.
Do you have any idea ?
This is a known problem. In fact your error message is giving exactly what went wrong. The script could not create Symbolic link (a Shortcut) for en_core_web_md. Perform the following to fix the issue
Goto your directory: C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\data\
Create a shortcut to destination: C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\en_core_web_md
Name it as en
If you want to know how to create the shortcut, following screenshots might help
Goto the folder, C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\spacy\data\ and right click and create shortcut
Provide the target directory: In you case it is
C:\Users\antoi\Documents\Programming\Nathalie\Chatbot_RASA_room_reservation\cha_env36\lib\site-packages\en_core_web_md
Then click on Next
You have to name the shortcut as en. Then click on Finish
Following the log that you have provided.
Is possible to be a permission problem.
Try to open CMD with Administrator privileges, and then run spacy link command again.
What I did was open bash as admin, then run the command:
python -m spacy link en_core_web_md en
If you are using a virtualenv make sure to activate the said virtualenv first.
You can also use the mklink command in cmd to create a symbolic link in the desired folder.
MKLINK [[/D] | [/H] | [/J]] Link Target
/D Creates a directory symbolic link. Default is a file
symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction.
Link Specifies the new symbolic link name.
Target Specifies the path (relative or absolute) that the new link
refers to.
I am using a Fortran code that uses HDF5 (1.10.1). At some point there is a call to open a file using h5fopen_f:
H5FileName = "+hdf5/Temperature_00000_00001.h5"
CALL h5fopen_f(H5FileName, H5F_ACC_RDWR_F, file, hdferr)
Scalardataset = 'Temperature_00001_0000'
call h5ltget_dataset_info_f(file, Scalardataset, dimstmp, type_class, type_size, hdferr)
call h5fclose_f(file,hdferr)
which is giving me an error:
HDF5-DIAG: Error detected in HDF5 (1.10.1) MPI-process 0:
#000: H5F.c line 586 in H5Fopen(): unable to open file
major: File accessibilty
minor: Unable to open file
#001: H5Fint.c line 1305 in H5F_open(): unable to lock the file
major: File accessibilty
minor: Unable to open file
#002: H5FD.c line 1839 in H5FD_lock(): driver lock request failed
major: Virtual File Layer
minor: Can't update object
#003: H5FDsec2.c line 940 in H5FD_sec2_lock(): unable to lock file, errno = 11, error message = 'Resource temporarily unavailable'
major: File accessibilty
minor: Bad file ID accessed
I have checked that the file exists, it's where it should and that I have the right permissions. Also, the code works fine when I just use one process, and when I use more than one, one of the processes is able to open the file ( err=0 ), but the rest can't ( err=-1 ). Finally, I have this same code installed somewhere else and it works just fine (with version 1.8.14).
Can this be a problem with the version?
I found two ways of fixing this:
Opening the files as read only, using H5F_ACC_RDONLY_F instead of H5F_ACC_RDWR_F (this is fine for me because I don't need to write.
Recompiling everything using HDF5 1.8.14. I guess that read and write permissions are more restrictive in version 1.10.x than in version 1.8.x.
Ideally I would like to be able to use a more up to date version of HDF5 together with H5F_ACC_RDWR_F, but for now it works for me.
I had a very similar issue with HDF5 1.10.1. We are using multiple readers to access a file in H5F_ACC_RDONLY mode.
Disabling file locking by setting the environment variable seems to resolve the H5FDsec2.c line 940 in H5FD_sec2_lock(): unable to lock file, errno = 11, error message = 'Resource temporarily unavailable':
export HDF5_USE_FILE_LOCKING="FALSE"
This env var is checked at runtime by hdf5. See: https://support.hdfgroup.org/ftp/HDF5/current/src/unpacked/release_docs/RELEASE.txt