Trying to Update Python 3 Using Homebrew - python-3.x

'''
(base) Kiefer's Macbook Pro:~ kiefergallant$ brew upgrade python3
Error: The following directories are not writable by your user:
/usr/local/share/man/man8
You should change the ownership of these directories to your user.
sudo chown -R $(whoami) /usr/local/share/man/man8
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man8
(base) Kiefer's Macbook Pro:~ kiefergallant$
'''
Having a hard time updating python3 so I can use Tkinter

Related

docker-compose:The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user

I'm running 5 docker containers on Ubuntu 22.04. I have created a user and added to the group and logged in by
sudo su 'user'
I have installed virtualenv and running inside of it. All my commands are without sudo.
When i run docker-compose.yml , i see 2 warnings which are as follows:
1.The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag
2.Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
When i run the commands, there is clearly
(myEnv)user#instance-2:~/okuna-api$
which means the venv is activated.
I have already done the following :
sudo addgroup mygroup
sudo adduser user mygroup
sudo chown -R user:mygroup /home/user
sudo chmod -R g+rwX /home/user
sudo chmod 777 /var/run/docker.sock
This is a continuation to my question which isn't answered yet :
Django rest API : Python command-line .py execution: Stuck at a certain place
The core issue seems the permissions to the /root folder. I'm unable to find the right command to enable the user with read and write permissions to the root folder. Also,the docker group is created and I have already tried the following after adding user to the docker group:
sudo chown -R user:mygroup /root/.cache/pip/
But the warning still persists. I can't figure what else to do.kindky help.

Updating nodejs with homebrew dilemma: need more permission but brew doesn't work with sudo?

I am trying to update node from 10 to 12 on my mac 11.6 (20G165).
And I would like to use the homebrew way:
brew upgrade node
However, after running this, I got:
$ brew upgrade node
Error: The following directories are not writable by your user:
/usr/local/share/man/man5
/usr/local/share/man/man7
Well, then I tried the sudo way:
sudo brew upgrade node
Password:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
What should I do to fix it now?
Can I just grant the
/usr/local/share/man/man5
/usr/local/share/man/man7
directories to my current user? Is there any risk by doing so?
My homebrew version:
Homebrew 3.2.17
Homebrew/homebrew-core (git revision 0e79905a9e5; last commit 2021-10-20)
Well I had a same problem, and solved it by commands provided which were followed by error.
sudo chown -R $(whoami) /usr/local/share/man/man5 /usr/local/share/man/man7
And make sure that your user has write permission.
chmod u+w /usr/local/share/man/man5 /usr/local/share/man/man7

Accidentaly ran pip with sudo

After that I always get permission error when trying to install anything with pip. Is there any way to safely return everything back to normal?
You have run sudo -H pip install; sudo ran pip as root and pip changed ownership of some files and directories under your home dir. Take the files back:
sudo chown -R $USER $HOME

Error in creating virtualenv in ubuntu 16.04.2 LTS

Hello I am getting following error during virtualenv creation.
Here is the error:
$ mkvirtualenv cv
ERROR: virtualenvwrapper could not find /usr/local/bin/virtualenv in your path
Before this I was getting some weird message during the run of following commands:
sudo python get-pip.py
sudo pip install virtualenv virtualenvwrapper
Here is the weird message:
The directory '/home/myusername/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/myusername/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
If I run this command sudo apt install virtualenv or virtualenvwrapper then I don't get the above weird message. but this don't help me to create virtualenv
python path is /usr/bin/python
Can anybody help me to figure out the issue by providing detailed command?
First, let's clear your "weird" message. It means that you've already used sudo -H before and sudo changed ownership for some of your files to root. Take the files back with the command
sudo chown -R myusername /home/myusername
(change myusername to your real login name; I used the name you've used in your question.)
After that upgrade pip and follow installation instructions for virtualenv and virtualenvwrapper:
sudo pip install -U pip setuptools virtualenv virtualenvwrapper
source /usr/local/bin/virtualenvwrapper.sh

Running conda install as an admin on my ubuntu server, I get "Missing write permissions: /home/ubuntu/anaconda3"

I have installed Anaconda3 on my ubuntu server.
When I attempt to install or upgrade any package using conda, for example:
conda install numpy=1.11.0
(of course you cannot do "sudo conda")
I receive the following error:
Error: Missing write permissions in: /home/ubuntu/anaconda3
#
# You don't appear to have the necessary permissions to install packages
# into the install area '/home/ubuntu/anaconda3'.
# However you can clone this environment into your home directory and
# then make changes to it.
# This may be done using the command:
#
# $ conda create -n my_root --clone=/home/ubuntu/anaconda3
As #cel pointed out, providing the correct permissions is all that is necessary:
sudo chown -R ubuntu /home/ubuntu/anaconda3
sudo chmod -R +x /home/ubuntu/anaconda3

Resources