I downloaded this code from github and it runs fine on my local computer, but I need to use in google colab, where it throws errors. More precisely, what I get as error output is:
/bin/sh: 1: ./rbox: Permission denied
/bin/sh: 1: ./qhull: Permission denied
...
ModuleNotFoundError: No module named 'python_tools.fastmodules'
The full error message can be seen here as well as in the notebook here. I tried different suggestions for giving permission for executing the files ./rbox and ./qhull - I inserted a new cell before the code snippet containing
!chmod 755 -R /content/gdrive/MyDrive/PhD/revolver/qhull/src/ #pointing to the file-directory
or
!chmod 755 ./rbox
or
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/src/rbox
but none of them solves the error. How can I resolve the error message? It would be also great if someone can download the github code from the link into google drive confirm that he can run it without errors. Installations instructions are provided on the github page, you can use my params.py file and within it you can set tracer_file to point at this file that I used, or any dummy csv-file with 3 columns. Tnx! Your contribution would help me run an astrophysics simulation for my PhD
I made a mistake by confusing the location of my files. There were different copies of the rbox and qhull files in different folders, so I should have done
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/rbox
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/qhull
instead of
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/src/rbox
!chmod +x /content/gdrive/MyDrive/PhD/revolver/qhull/src/qhull
Related
I attempted to follow the instructions from this link https://prishitakapoor2.medium.com/configuring-git-bash-to-run-python-for-windows-a624aa4ae2c5 to setup python with git bash. However when I attempt to run source .bashrc I receive the following error
bash: export: python.exe export PATH=/mingw64/bin:/usr/bin:/c/Users/Grant/bin:/c/Program Files/Oculus/Support/oculus-runtime:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Program Files (x86)/Common Files/Intel/Shared Libraries/redist/intel64/compiler:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Program Files (x86)/AMD/ATI.ACE/Core-Static:/c/Program Files (x86)/Calibre2:/c/Program Files (x86)/QuickTime/QTSystem:/c/WINDOWS/System32/OpenSSH:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/Program Files/dotnet:/c/Program Files (x86)/Microsoft SQL Server/150/DTS/Binn:/c/Program Files/Azure Data Studio/bin:/cmd:/c/Udacity/Python:/c/Udacity/Python/Library/mingw-w64/bin:/c/Udacity/Python/Library/usr/bin:/c/Udacity/Python/Library/bin:/c/Udacity/Python/Scripts:/c/Users/Grant/AppData/Local/Microsoft/WindowsApps:/c/Program Files/Azure Data Studio/bin:/c/Users/Grant/AppData/Local/atom/bin:/c/Users/Grant/Anaconda3:/c/Users/Grant/Anaconda3/scripts alias python=winpty:/c/users/grant/anaconda3:/c/users/grant/anaconda3/Scripts:\C\Users\Grant\anaconda3:\C\Users\Grant\anaconda3/Scripts:\C\Users\Grant\Desktop\anaconda3:\C\Users\Grant\Desktop\anaconda3\Scripts:/c/Users/Grant/Anaconda3:/c/Users/Grant/Anaconda3/scripts': not a valid identifier bash: .bashrc: line 13: unexpected EOF while looking for matching "'
I have attempted to uninstall both batch and anaconda and reinstall both to fix the issue but I am unable to resolve the problem. Any tips? I am very new to this and trying to get python setup on my local PC for the first time.
I attempted to update the path by using the echo 'export PATH="$PATH:[YOUR_PATH]:[YOUR_PATH]/Scripts"' >> .bashrc again but this did not allow me to change the path and I am still receiving the same error.
As error tells, you have unmatched " in your .bashrc file. To more accurate answer,will be good if you attach .bashrc file
Im completely new to Docker and I'm trying to create and run a very simple example using instructions defined in a DockerFile.
DockerFile->
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y python3 pip
COPY ./ .
RUN python3 test.py
contents of test.py ->
import pandas as pd
import numpy as np
print('test code')
command being used to create a Docker Container ->
docker build --no-cache . -t intro_to_docker -f abs/path/to/DockerFile
folder structure -> (both files are present at abs/path/to)
abs/path/to:
-DockerFile
-test.py
Error message ->
error from sender: open .Trash: operation not permitted
(using sudo su did not resolve the issue, which i believe is linked to the copy commands)
I'm using a Mac.
any help in solving this will be much appreciated!
The Dockerfile should be inside a folder. Navigate to that folder and then run docker build command. I was also facing the same issue but got resovled when moved the docker file inside a folder
Usually the error would look like:
error: failed to solve: failed to read dockerfile: error from sender: open .Trash: operation not permitted
And in my case, it's clearly saying that it is unable to find the dockerfile.
Also, in your command, I see a . after --no-cache, I think that's not required?
So better, try navigating to the specified path and then run the build command replacing the -f option with a ., which specifies the build command to consider the current folder for its build process.
In your case
cd abs/path/to/
docker build --no-cache -t intro_to_docker .
It seems the system policies are not allowing the application to execute this command. The application "Terminal" might not have approval to access the entire file system.
Enable full disk access to terminal. Change it using "System Preferences > Security & Privacy > Privacy > Full Disk Access"
I had the same error message and my Dockerfile was located in the HOME directory, I moved the Docker file to a different location and executed the docker build from that newly moved location and it successfully executed.
part of my python script is as below
panda_dataframe.to_csv("myfile.csv")
The code is working fine in my Dev System.
I have deployed it in EC2 - Ubuntu. The above statement return Server Error (500)
I have also tried with
panda_dataframe.to_csv("/usr/share/myfile.csv")
But the same error.
Error.log has the below error.
PermissionError: [Errno 13] Permission denied: '/usr/share/myfile.csv'
I have tried with setting the below permisions
sudo setfacl -m u:www-data:rw /var/www/sitefolder/myfile.csv
sudo setfacl -m g:www-data:rw /var/www/sitefolder/myfile.csv
Guide me what is the permission I have to assign to write the dataframe into a csv file
Your working directory is /usr/share, and saving/deleting/copy/move actions in /user directory requires sudo privileges. so first check you user directory by executing echo $HOME. say the result is /home/amir. now save you data frame as:
panda_dataframe.to_csv("/home/amir/myfile.csv")
I've created an object detection model using Roboflow's tutorial and have all the saved weights. The one problem I have is deploying it in a Google Colaboratory. I've changed up some code, but it does not seem to work. So in short, model's trained.
How do I use the model in another Google Colaboratory? I've downloaded the whole darknet folder to the environment with a direct download, some plotting functions and then ran:
and then
!./darknet detect cfg/custom-yolov4-detector.cfg backup/custom-yolov4-detector_last.weights {img} #-dont-show
Only to get:
/bin/bash: ./darknet: Permission denied
Any suggestions?
Just add this before your command:
!chmod +x ./darknet
In step 4 of this tutorial you will find the command !chmod +x ./darknet. Depending on your directory, you may need to run !chmod +x ./darknet/darknet. It depends on your folder structure. Worked for me.
need to re-run the darknet !make file
%cd /your_path/
!sed -i 's/OPENCV=0/OPENCV=1/g' Makefile
!sed -i 's/GPU=0/GPU=1/g' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/g' Makefile
!sed -i "s/ARCH= -gencode arch=compute_60,code=sm_60/ARCH= ${ARCH_VALUE}/g" Makefile
!make
you are lacking execution permission for that script, you need to do chmod +x darknet
If your files are already compiled using !make command, then use !chmod +x ./darknet/darknet or else first compile it and then use !chmod +x ./darknet/darknet
If it still doesn't work, delete the entire darknet package and then clone it again.
compile the darknet using the make function
!make
and don't forget to change the makefile
GPU=1
CUDNN=1
OPENCV=1
I am using python fabric in my project mainly for deployment to the remote server. Inside the fabfile, i have written a function named deploy() for pulling the code to the github. When i execute the command "fab deploy", it results in an error like this:
error: cannot open .git/FETCH_HEAD: Permission denied
Please help me in resolving this issue. Any help is much appreciated. Thanks in advance
Check permissions and ownership of .git directory and files in it
ls -al .git | grep FETCH_HEAD
There should be something like -rw-r--r-- at the beginning of output.
If not fix it by setting them by:
sudo chmod -R 0755 .git