Skip to content

How to install required dependencies? (not a python user here) #252

Closed

Description

@marsitatheultra

I'm following tutorial: https://github.com/WikiTeam/wikiteam/wiki/Tutorial#requirements

I'd say that there are other requirements too (will edit wiki once I manage to complete the process)

sudo easy_install pip

sudo pip install kitchen
sudo pip install requests

python dumpgenerator.py --api=___SOME___URL___HERE --xml

Please install the kitchen module.
Please install or update the Requests module.

I thought I've just installed the required packages? (I've also restarted my terminal)

When at first I tried without sudo there were some path permissions errors.

This is the first time in year when I'm using anything related to python other than SimpleHTTPServer... And I believe than your 5 minute of effort can save me a lot of time (I'd rather focus on my wiki, rather than solving some dependencies jigsaw - I was never good at it)

Activity

  1. Hydriz commented on Sep 22, 2015

    @Hydriz
    Member

    Are you able to load those packages from other scripts? You can see if those packages are accessible when you open the interactive Python in the terminal and try to import those packages.

    Do the following steps if you are unclear:

    1. Open your Terminal
    2. Type "python" to open the interactive Python interface
    3. Type "import kitchen".

    If the above fails, it is likely that it is an issue with your system.

  2. emijrp commented on Sep 22, 2015

    @emijrp
    Member

    Why do we use kitchen? Is it a recently added dependence?

    2015-09-22 8:53 GMT+02:00 Hydriz Scholz notifications@github.com:

    Are you able to load those packages from other scripts? You can see if
    those packages are accessible when you open the interactive Python in the
    terminal and try to import those packages.

    Do the following steps if you are unclear:

    1. Open your Terminal
    2. Type "python" to open the interactive Python interface
    3. Type "import kitchen".

    If the above fails, it is likely that it is an issue with your system.

    —
    Reply to this email directly or view it on GitHub
    #252 (comment).

  3. nemobis commented on Sep 22, 2015

    @nemobis
    Member

    Emilio J. Rodríguez-Posada, 22/09/2015 11:31:

    Why do we use kitchen? Is it a recently added dependence?

    It was added some time ago to reduce Unicode errors.

  4. silpol commented on Sep 22, 2015

    @silpol

    @stefek99 you seem to do same mistakes as me when I was at point 0 of learning curve.

    • python works much better with virtualenv so make it installed
    sudo apt-get install virtualenv
    • then make some place where you put your dumpgenerator
    cd
    mkdir whateverwikiyouwanttoarchivename
    cd whateverwikiyouwanttoarchivename
    • then make inside that directory virtualenvironment, named e.g. venv (think of it is directory with bunch of python things just to make your project safely work)
    virtualenv venv --no-site-packages
    • note that --no-site-packages above -- it will make your life much easier as it will create full replica of python (not big, don't worry) and you won't have conflicts between system-wide python packages (e.g. via sudo apt-get instal ... or sudo pip install ...). Just forget for sudo pip ... altogether now.
    • now switch to your environment
    source venv/bin/activate

    or
    (that's dot instead of keyword source)

    . venv/bin/activate
    • you will see your command prompt switch to something like
    (venv)username@host:~/path$
    

    you did NOT launch any new shell, just rehashed some settings, so do NOT press on Ctrl+D to leave it, rather use keyword deactivate when you've done everything

    • now you are very close - just pip install everything you need as dependency
    pip install kitchen
    pip install request

    (note no sudo fired in progress)

    • now you can fire your dumpgenerator
    python dumpgenerator.py --api=___SOME___URL___HERE --xml
    • it should work now, at least you should not get python error stacks
    • path permission errors were because you didn't make that virtual environment (directory which we named venv just to have some handle), so pip has been trying to put it where system-wide python located, and it bumped into acls not allowing you to do so. When you added sudo, it basically forced installation into system-wide place. But it can create bunch of other problems, from future updates to conflict resolutions in version updates to package cache problems and few else. And when you fired dumpgenerator, the python interpreter didn't have proper environment, so it didn't see packages
  5. marsitatheultra commented on Oct 5, 2015

    @marsitatheultra
    Author

    Thank you.

    Next time I do the backup I'll follow instructions from here.

  6. Hydriz commented on Oct 7, 2015

    @Hydriz
    Member

    Added a link to this task, thanks for your help @silpol!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions