I am working on a Windows10 machine which is restricted by centrally managed guidelines and rules. For example, it is not possible for a normal user to run programs residing in other directories than C:\Program Files... which prevents normal users from installing software on our Windows machines. I do have a localadmin user allowing me to run programs residing in other directories and install software. With the help of the localadmin user I managed to install pyenv-win following the instructions given at official PyPi documentation. As it seems, pyenv is running well, at least I can call pyenv in the PowerShell and it reacts like expected.
Now, I want to install Python versions using pyenv for my normal user (as I do not want to work/program as localadmin). However, if I try pyenv install <version> as a normal user, I get an error message that the execution of pyenv-install.vbs is blocked due to group rules. I can install Python versions using the localadmin, but the Python installed in this way ends up in the localadmin's directory ...\localadmin user directory\.pyenv\pyenv-win\install-chache\python-...exe which is not accessible for normal users.
Question is, how can I make pyenv Python environments accessible to normal users? One workaround seems to me that I use the localadmin user and perform pyenv install pointing to some custom directory - e.g. pointing to my normal user's .pyenv\ directory. Is that possible? What would be the command for this?
Related
When I pip install AnyPackage I receive output telling me that it is "Defaulting to user installation because normal site-packages is not writeable":
I have tried uninstalling Python, but it does not solve the problem.
I am using an admin account on windows-10 Home Edition, and running python-3.9, (downloaded directly from python.org), installed using the "add to path" option.
It is worth noting that I can't access any package from cmd, for instance:
P.S Why does it install the package in AppData\Roaming\Python\Python39\Scripts, when Python is installed to C:\Program Files\Python39?
As for my goal, I would like to avoid any future problems this might cause me.
I would also like to be able to create a virtual environment, using virtualenv.
For me not using my IDE with virtual environment solved the problem and to install all modules using administrator privileges.
Use bash to install packages instead of Powershell
I am a windows user and a beginner in python. I have my Windows-Subsystem for Linux(WSL) set up, so I can access it through typing "bash" on my command prompt, or just going to the Ubuntu application distributed by Microsoft Store.
I wanted to install mathplotlib using WSL ubuntu, so I used
"sudo pip install mathplotlib"
. to install the package in my global environment.
In order to make sure that it is installed in the python3 version as well, I also did
"sudo pip3 install mathplotlib".
Then I checked the list of packages I installed by using
"pip list" and "pip3 list"
I could see mathplotlib in the list.
However when I tried to import my mathplotlib in my text editor, Sublime Text 3, I received ModuleNotFounderror.
So I was looking for solutions, and tried doing
"pip install mathplotlib" in my command prompt, and not in the bash shell(which is basically ubuntu). Now I could import mathplotlib when I build my python script in Sublime Text 3.
Why is this happening? Is "pip install" useless in Windows-Subsystem for Linux?
1. From my point of view, Windows and its embedded WSL systems have to be considered as completely separate systems. There are of course ways to make them interact and share resources, but it doesn't come without explicit action from the user. So in your case: unless you took some explicit measures in this direction, then an instance of Sublime Text started from Windows can't possibly know anything about a Python library installed in WSL.
2. Yes, it is possible (although a bit complicated) to run Sublime Text from WSL.
These two points are off-topic for Stack Overflow, and I would recommend you to ask follow-up questions on Super User for example.
I am experiencing unexpected/unusable behavior from pip and virtualenvs. For context, I am using fish shell.
When I create a new virtual env and install new packages to it, pip list/freeze correctly shows the installed packages. However, which pip routes to my system python, not my virtual environment python.
Before and after entering my virtualenv, which pip returns the same system path. Further, when I run code, my import statements do not detect installed packages.
I've spent days looking through over posts before asking, but I haven't found one that describes my exact situation / an adequate solution.
It is not a problem due to:
- aliases
How can I fix this?
Virtualfish is a project designed to gracefully handle virtual environments in a Fish shell context. You may find it provides a solution to the problems you are experiencing, as well as a number of other significant benefits.
I'm trying to use a Conda installation that was installed by a user other than myself, and with the root installation directory having read only perms.
Supposedly this is doable in the latest version of Conda and the envs_dirs setting, but even with the envs_dirs setting set to a writable path, Conda still tries to create locks in the read only root install path. Is there any way around this?
For anyone looking at this in the future - https://github.com/conda/conda/issues/1329
This issue addresses a multitude of problems with running shared user environments in Conda. As of time of this posting, it's partially supported and somewhat hacky, though check the link for status.
By default nodejs is installed in /usr/local/bin/node but this location needs root access rights.
If I then install a global package like grunt-cli or a yeoman generator they also need root access rights. But I don't want to install all global packages with sudo.
So I tought why not install node and its global packages under something like opt/bin/node for example and give this location user access rights.
I used to download the installer from the nodejs website but with that I can't change location of the installation. So the question is:
How can I install nodejs in a differnt location than the default location on OSX and Windows?
Search engines are your friend.
Taken directly from the node docs:
On Windows
The http://nodejs.org/dist/latest/ directory contains executables of
the last version of Node.js engine (the engine only, i.e. without
npm):
32bit version: http://nodejs.org/dist/latest/node.exe
64bit version: http://nodejs.org/dist/latest/x64/node.exe
The http://nodejs.org/dist/npm/ directory contains the latest .zip
archive of npm (such as npm-1.1.16.zip when npm v1.1.16 was the
latest).
Manual installation steps:
Make a clean directory and add that directory to your system's PATH variable.
Download the latest node.exe to that directory.
Download the latest npm's .zip file and unpack its contents to the same directory.
Then, with the usual help of PATH, you'll be able to run scripts (node
scriptname.js) and install modules (npm install modulename) in any
directory.
...and just below that...
Installing on Mac
The http://nodejs.org/dist/latest/ directory contains the latest .pkg
package (such as node-v0.6.15.pkg when Node v0.6.15 was the latest).
we have discussed your issue with some unix guru´s.
in UNIX / MAC:
we believe the best way to install a node package "global" (non-project-specific respectively in your user environment) is to install node in folder
/opt/node or /home/user/.node and change the user-right, as you mentioned.
we believe its the wrong way, to change the /usr/ folder-rights or install global-packages with sudo.
in my case, i think the solution to change npm-config (mentioned in many other stackoverflow topics) did not changed anything, because node is still installed in /usr/bin.
still we belief, as a developer its more recommended to build such frequently updated applications like node by yourself instead of using the unix package manager. because mostly the resources ain't up to date.
I've had great success with nvm: https://github.com/creationix/nvm. It's a version manager for node, but one of the best parts of it (for me) is that it installs each version of node in your home directory. This means that your npm global install is also in this home directory. It's a Mac/Unix solution.
For Windows, though I've never tried it, there is the (similar) nvmw project: https://github.com/hakobera/nvmw.