LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to run bzr (installed manually, no root access) (https://www.linuxquestions.org/questions/linux-software-2/how-to-run-bzr-installed-manually-no-root-access-4175559190/)

dedec0 11-18-2015 08:26 AM

How to run bzr (installed manually, no root access)
 
Hello,

the machine I'm using uses Ubuntu 14.04, but everything I do and want here should be naturally the same for other distros. I have no root access to this machine.

I downloaded and installed bzr for my user:

Code:

# Download the package
apt-get download bzr

# Extract it on a temporary directory
dpkg -x bzr_2.6.0+bzr6593-1ubuntu1.1_all.deb

# Move it to an user folder which is already in my PATH variable
mv etc usr ~/.localRootFolder

This works fine for many programs I need but can't install, or just don't want. Developed programs also benefit with these steps.

But, for bzr, I have this error I don't know how to solve:

Code:

$bzr branch lp:ubuntu/wily/org-mode #bazaar
bzr: ERROR: Couldn't import bzrlib and dependencies.
Please check the directory containing bzrlib is on your PYTHONPATH.

Traceback (most recent call last):
  File "/home/me/.localRootFolder/usr/bin/bzr", line 74, in <module>
    import bzrlib
ImportError: No module named bzrlib

I have "installed" bzrlib package with the the steps shown above. But it does not work.

What should I do in this and similar cases?

It seems the problem is solved before I made the post... LOL... I copied the extracted folder ./usr/lib/python2.7/dist-packages/bzrlib/ to my local path in ~/.localRootFolder/usr/bin/.

Any comments or possible problems with this, please tell me. I'm probably unaware of it.

----------------------
"Not-tags" I could not use for this thread:

ubuntu mint python install

berndbausch 11-18-2015 09:11 AM

If you want to run python programs in your own environment, you are a candidate for virtualenv, which will correctly set up libraries and paths.
You should also consider using pip install (when you are inside your virtual environment) instead of dkpg and install your programs from pypi.python.org.

Your error can proably be explained with a wrong Python lib path configuration variable (whose name I currently don't remember).

dedec0 11-18-2015 10:53 AM

Quote:

Originally Posted by berndbausch (Post 5451477)
If you want to run python programs in your own environment, you are a candidate for virtualenv, which will correctly set up libraries and paths.
You should also consider using pip install (when you are inside your virtual environment) instead of dkpg and install your programs from pypi.python.org.

Your error can proably be explained with a wrong Python lib path configuration variable (whose name I currently don't remember).

I don't want to look if a program is from pypi or not - like this one that I didn't even knew it is.

$PYTHONPATH... I imagined that it could be a solution, but it seems it may not be the case.

The site of virtualenv points a few problems with other Python virtual environments...

(Just a loose comment: why can't Python programs relay in simple things like many many other programs that exist?)


Can I install virtualenv without root access?? If I cannot do it, it is no solution at all, not even a starting one.

273 11-18-2015 11:11 AM

Ask somebody with root access to install what you need. That's, presumably, their job. Why the need to make things difficult?

dedec0 11-18-2015 11:51 AM

Highly useful notes are found here:

"Whats the proper way to install pip virtualenv and distribute for python"

http://stackoverflow.com/questions/4324558/

dedec0 11-18-2015 11:56 AM

Quote:

Originally Posted by 273 (Post 5451532)
Ask somebody with root access to install what you need. That's, presumably, their job. Why the need to make things difficult?

This is not possible. It is not difficult at all what I want. I run many programs without needing any root access to install or to use them for everything I need to do. So, I have no reason to want to install this Python program (as many others) for everybody if it is just me using it.

It being a program that everybody else may want is a possibility. But then we are assuming more about the whole world than what the truth is many times.

Also, eventually we just cannot wait. Why being jailed to make simple things? I don't think it is difficult at all. I think it's useful in many aspects.

Gladly, a neat solution appeared, I found it. :) Although I don't need it now, since my Bazaar is working with the simple and almost naive solution.

273 11-18-2015 12:01 PM

Quote:

Originally Posted by dedec0 (Post 5451551)
This is not possible. It is not difficult at all what I want. I run many programs without needing any root access to install or to use them for everything I need to do. So, I have no reason to want to install this Python program (as many others) for everybody if it is just me using it.

It being a program that everybody else may want is a possibility. But then we are assuming more about the whole world than what the truth is many times.

Also, eventually we just cannot wait. Why being jailed to make simple things? I don't think it is difficult at all. I think it's useful in many aspects.

Gladly, a neat solution appeared, I found it. :) Although I don't need it now, since my Bazaar is working with the simple and almost naive solution.

The fact that anything runs without root saying so seems more like an accident than design. Assuming your development team is set up to run without root permissions your system administrators are still being paid to help you and should know when issues happen so that things will continue to work smoothly. I really don't see any reason not to involve your system administrators here and every reason to do so. Aren't you all working for the same company to the same ends?

berndbausch 11-18-2015 03:38 PM

Quote:

Originally Posted by dedec0 (Post 5451525)
The site of virtualenv points a few problems with other Python virtual environments...

So I guess it adresses them.
Quote:

Originally Posted by ashi.srma1986 (Post 5451452)
(Just a loose comment: why can't Python programs relay in simple things like many many other programs that exist?)

You mean things like libraries? And the need to be root to install software? Seems to me that other software does the same thing. Let's not turn this into a flame war though.
Quote:

Originally Posted by ashi.srma1986 (Post 5451452)
Can I install virtualenv without root access?

Yes. Which is precisely the point.

dedec0 11-22-2015 10:04 AM

Quote:

Originally Posted by berndbausch (Post 5451662)
So I guess it adresses them.

No. It means that it is known.

Quote:

Originally Posted by berndbausch (Post 5451662)
You mean things like libraries? And the need to be root to install software? Seems to me that other software does the same thing. Let's not turn this into a flame war though.

No.

Quote:

Originally Posted by berndbausch (Post 5451662)
Yes. Which is precisely the point.

The point is to have clear instruction on how to install something without root and to show how to run a program (also without being root). https://virtualenv.pypa.io/en/latest/installation.html does not show this.

If you do not want to help, please stop saying your opinion against the idea. I'm sure there are more people around here that will be happy to answer within my needs. Thank you very much

berndbausch 11-22-2015 08:15 PM

While the original poster seems to be happy with another solution, others might want to know how to use virtualenv. This is what I usually do:
  1. Install virtualenv https://virtualenv.pypa.io/en/latest/installation.html
  2. Create an environment https://virtualenv.pypa.io/en/latest/userguide.html
  3. Enter it using the activate script https://virtualenv.pypa.io/en/latest/userguide.html
  4. Install whatever app I want to use in the virtual environment pip install whateveriwant.
  5. Run, develop, debug etc the application
  6. Exit the virtual environment using the deactivate script https://virtualenv.pypa.io/en/latest/userguide.html

Later, each time I want to use the application in the virtual environment, steps 3, 5 and 6 again.

Quote:

Originally Posted by dedec0 (Post 5453607)
If you do not want to help, please stop saying your opinion against the idea. I'm sure there are more people around here that will be happy to answer within my needs. Thank you very much

Strange comment from someone who received tips and gave her/his own opinion.


All times are GMT -5. The time now is 01:43 PM.