[ckan-dev] How to install ckanext-scheming

Forum forum at hello-web.net
Thu Sep 22 11:17:37 UTC 2016


Ok, I think I solved the problem.


As I said, I install CKAN from package.

Because of my issue, I red the doc and I compare the instruction to 
install CKAN from source. I also compare the file permissions of 
/usr/lib/ckan/default

http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html

The instruction to install from source said:


 1.

    Create a Python virtual environment <http://www.virtualenv.org>
    (virtualenv) to install CKAN into, and activate it:

    sudo mkdir -p /usr/lib/ckan/default
    sudo chown `whoami` /usr/lib/ckan/default
    virtualenv --no-site-packages /usr/lib/ckan/default
    . /usr/lib/ckan/default/bin/activate



In red, I could understand thta my file permission was not correct. I 
ran the following command

sudo chown -R `whoami` /usr/lib/ckan/default


and then I try to install again ckanext-scheming and it work (see below).


*But why the installation from package do not set the correct permission?*

/
/

/(default)cry at crypc11:/usr/lib/ckan/default/src/ckan$ pip install -e 
'git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming'//
//Obtaining ckanext-scheming from 
git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming//
//  Directory /usr/lib/ckan/default/src/ckanext-scheming already exists, 
and is not a git clone.//
//  The plan is to install the git repository 
https://github.com/ckan/ckanext-scheming.git//
//What to do?  (i)gnore, (w)ipe, (b)ackup w
   Deleting /usr/lib/ckan/default/src/ckanext-scheming
   Cloning https://github.com/ckan/ckanext-scheming.git to 
/usr/lib/ckan/default/src/ckanext-scheming
Installing collected packages: ckanext-scheming
   Running setup.py develop for ckanext-scheming
Successfully installed ckanext-scheming
You are using pip version 7.1.2, however ver//sion 8.1.2 is available.//
//You should consider upgrading via the 'pip install --upgrade pip' 
command./

/
/

/
//(default)cry at crypc11:/usr/lib/ckan/default/src/ckan$ pip install 
--upgrade pip//
///usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: 
InsecurePlatformWarning: A true SSLContext object is not available. This 
prevents urllib3 from configuring SSL appropriately and may cause 
certain SSL connections to fail. For more information, see 
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.//
//  InsecurePlatformWarning//
//Collecting pip//
//  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)//
//    100% |████████████████████████████████| 1.2MB 510kB/s //
//Installing collected packages: pip//
//  Found existing installation: pip 7.1.2//
//    Uninstalling pip-7.1.2://
//      Successfully uninstalled pip-7.1.2//
//Successfully installed pip-8.1.2//
/

/
/

/
/

/(default)cry at crypc11:/usr/lib/ckan/default/src/ckan$ /








On 9/22/16 12:59 PM, Forum wrote:
>
> Dear Tim
>
>
> Unfortunately, it does not work. Here is the error messages:
>
> I manually created //usr/lib/ckan/default/src/ckanext-scheming/ 
> because it could not
> /
>
>
>
>
> /(default)cry at crypc:/usr/lib/ckan/default/src$ pip install -e 
> 'git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming'//
> //Obtaining ckanext-scheming from 
> git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming//
> //  Directory /usr/lib/ckan/default/src/ckanext-scheming already 
> exists, and is not a git clone.
>   The plan is to install the git repository 
> https://github.com/ckan/ckanext-scheming.git//
> //What to do?  (i)gnore, (w)ipe, (b)ackup i//
> //    Complete output from command python setup.py egg_info:
>     Traceback (most recent call last):
>       File "<string>", line 18, in <module>
>     IOError: [Errno 2] No such file or directory: 
> '/usr/lib/ckan/default/src/ckanext-scheming/setup.py'//
> ////
> //    ----------------------------------------//
> //Command "python setup.py egg_info" failed with error code 1 in 
> /usr/lib/ckan/default/src/ckanext-scheming//
> /
>
> /
> /
>
> /
> /
>
> /(default)cry at crypc:/usr/lib/ckan/default/src$ ll ckanext-scheming///
> //total 8//
> //drwxr-xr-x 2 cry cry 4096 Sep 22 12:45 .///
> //drwxr-xr-x 4 root  root  4096 Sep 22 12:51 ..///
> /
>
> /
> /
>
> /
> /
>
> /(default)cry at crypc11:/usr/lib/ckan/default/src$ pip install -e 
> 'git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming'//
> //Obtaining ckanext-scheming from 
> git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming//
> //  Directory /usr/lib/ckan/default/src/ckanext-scheming already 
> exists, and is not a git clone.//
> //  The plan is to install the git repository 
> https://github.com/ckan/ckanext-scheming.git//
> //What to do?  (i)gnore, (w)ipe, (b)ackup w//
> ////Deleting ./ckanext-scheming
> Exception:
> Traceback (most recent call last):
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/basecommand.py", 
> line 211, in main
>     status = self.run(options, args)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/commands/install.py", 
> line 305, in run
>     wb.build(autobuilding=True)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/wheel.py", 
> line 705, in build
>     self.requirement_set.prepare_files(self.finder)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/req/req_set.py", 
> line 334, in prepare_files
>     functools.partial(self._prepare_file, finder))
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/req/req_set.py", 
> line 321, in _walk_req_to_install
>     more_reqs = handler(req_to_install)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/req/req_set.py", 
> line 433, in _prepare_file
>     req_to_install.update_editable(not self.is_download)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/req/req_install.py", 
> line 573, in update_editable
>     vcs_backend.obtain(self.source_dir)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/vcs/git.py", 
> line 109, in obtain
>     if self.check_destination(dest, url, rev_options, rev_display):
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/vcs/__init__.py", 
> line 257, in check_destination
>     rmtree(dest)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/_vendor/retrying.py", 
> line 49, in wrapped_f
>     return Retrying(*dargs, **dkw).call(f, *args, **kw)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/_vendor/retrying.py", 
> line 212, in call
>     raise attempt.get()
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/_vendor/retrying.py", 
> line 247, in get
>     six.reraise(self.value[0], self.value[1], self.value[2])
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/_vendor/retrying.py", 
> line 200, in call
>     attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
>   File 
> "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pip/utils/__init__.py", 
> line 90, in rmtree
>     onerror=rmtree_errorhandler)
>   File "/usr/lib/python2.7/shutil.py", line 239, in rmtree
>     onerror(os.listdir, path, sys.exc_info())
>   File "/usr/lib/python2.7/shutil.py", line 237, in rmtree
>     names = os.listdir(path)
> OSError: [Errno 13] Permission denied: 
> '/usr/lib/ckan/default/src/ckanext-scheming'//
> /
>
> /
> /
>
> /
> /
>
> /(default)cry at crypc11:/usr/lib/ckan/default/src$ /
>
>
>
> Is not a permission problem?
>
>
> Thank for your help
>
> Cheers
>
>
>
>
> On 9/21/16 5:34 PM, Timothy Giles wrote:
>>
>> The .activate just ensures you are in the virtual environment that 
>> ckan dev is installed in.
>>
>> You follow a very similar install process for almost all ckan 
>> extensions. Some have requirements.txt and/or dev-requirements.txt 
>> that need installing. Some extensions require supporting DB tables to 
>> be created (QA for example). Generally though, if you learn the 
>> procedure below, you can install almost all extensions without issue.
>>
>>
>> Regards Timothy
>>
>>
>> *From:*ckan-dev [mailto:ckan-dev-bounces at lists.okfn.org] *On Behalf 
>> Of *Forum
>> *Sent:* den 21 september 2016 15:53
>> *To:* CKAN Development Discussions <ckan-dev at lists.okfn.org>
>> *Subject:* Re: [ckan-dev] How to install ckanext-scheming
>>
>> Dear Tim,
>>
>> Thank for your help.
>>
>> When I firstly install ckan, I installed it from source and I used 
>> that command during the process
>>
>> . /usr/lib/ckan/default/bin/activate
>>
>> I reinstalled my PC with a new Ubuntu 14.04 installation and I 
>> installed successfuly CKAN from the package. I did not needed to use 
>> the above command.
>>
>> I supposed, even if I installed CKAN from package, I can use the 
>> above command and use pip?
>> I will try to install ckanext-scheming later or tomorrow.
>>
>> Cheers
>> Pierre
>>
>> On 9/21/16 3:38 PM, Timothy Giles wrote:
>>
>>     Pierre,
>>
>>     . /usr/lib/ckan/default/bin/activate
>>
>>     cd /usr/lib/ckan/default/src
>>
>>     pip install -e
>>     ”git+https://github.com/ckan/ckanext-scheming.git#egg=ckanext-scheming”
>>
>>     cd ./ckanext-scheming
>>
>>     pip install -r
>>     /usr/lib/ckan/default/src/ckanext-scheming/requirements.txt
>>
>>     ·Any issues, sudo the previous command *
>>
>>     As the rest of the instructions say, insert scheming_datasets in
>>     to your plugins line
>>
>>     Add in the scheming.presets section in to your config, just under
>>     the plugins section
>>
>>     Add in a scheming.dataset_fallback = false
>>
>>     Add in a scheming.dataset_schemas = ckanext.scheming:schemaname.json
>>
>>     Where schemaname.json is the JSON file that describes your schema
>>     (ie. list of metadata elements). As an example, I think there is
>>     camel.json and ckan_dataset.json
>>
>>     Create a similar template file called dataset.json and it will
>>     load as the default ‘new dataset’ schema/template.
>>
>>     Sorry – the json files are stored in
>>     ./ckanext-scheming/ckanext/scheming/…….
>>
>>     Hope the above helps
>>
>>     Tim
>>
>>
>>
>>
>>     _______________________________________________
>>
>>     ckan-dev mailing list
>>
>>     ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
>>
>>     https://lists.okfn.org/mailman/listinfo/ckan-dev
>>
>>     Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>>
>>
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> https://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe:https://lists.okfn.org/mailman/options/ckan-dev
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160922/37f5cd42/attachment-0003.html>


More information about the ckan-dev mailing list