RHEL Permission Denied whilst trying to Run Robot Framework - python

I am setting up Robot Framework on RHEL 8.4. I have python 3.6 installed on my machine. However, when I try to run robot from within python virtual environment it throws
-ksh: robot: cannot execute [Permission Denied]
I also ran whereis robot and gave all permissions to the robot file.
The error happens when I am trying to run robot as a user other than root from within the virtual environment however, it works fine when run within virtual environment as root.
However, I am not keen to continue normal development as root and would like this to work via my normal user.

It sounds quite strange but upgrading PIP resolved the issue.

While creating a new project. Select the parent directory to the folder where the RobotFramework file is stored. It will solve the problem.
C:\Robot Framework

Related

How do I activate a VSCode environment from ssh?

I am currently using VS Code on a server (through SSH). Everything works fine, and I installed Python packages and work with Python notebooks.
Now, I want to login to the server (not a problem) and run the Python code I created on VSCode, rather than executing it remotely.
My main issue is that I am not sure how to activate the Python environment (if there is one) that VSCode server's run so that the code can execute.
Is that possible?
I see I have a .vscode directory in my home directory, and there are package installation there.
After connecting vscode remotely, you can use it as a regular vscode, which is no different from running Python files locally:
install python
install pylance extension
choose correct interpreter
edit your code and run the python file.

Unable to Debug Dev Appserver using pycharm, but able to run fine

Attempting to run a python 2.7 app engine app locally using PyCharm (which uses dev_appserver) my machine is python 3.7 but I have a python 2.7 virtual env setup as the project interpreter, which works fine when running the project.
However when attempting to debug the same run config (which runs fine) I am getting the following error
ERROR: (dev_appserver) python2: command not found
I can run the python2 command in my terminal both inside and outside the virtual environment so I am not sure what is wrong here.
I am currently running Pop!_OS 20.04 LTS if that helps.
I have the same issue on mac catalina with Pycharm 2020.1.2.
I was able to start the debugger by using a "Python configuration", rather than a "App Engine Server" configuration. Steps below:
Click "Edit Configurations", and add a new "Python Configuration"
In the Script Path, enter the full path to dev_appserver.py
In Parameters, enter '--max_module_instances="default:1" .' (according to https://cloud.google.com/appengine/docs/standard/python/tools/using-local-server#debugging_with_pdb)
In Working Directory, enter the path to your project
This isn't perfect, but at least you can run the debugger within pycharm.
I look forward to a better answer some day that works with the "App Engine Server" configuration.
I had the same issue after starting new AppEngine projects on python 3. Initially, I thought the problem was with a new version of Google Cloud SDK. I spent a lot of time linking/unlinking python versions and playing around the environment variables.
But eventually, update of PyCharm to 2021.1.2 fixed the issue.

Run python program from pip venv without system python

The answer to this question could be "You're as dumb as a wooden bowl" but I have searched a lot and haven't found a solution without installing python on other computers.
I have a python/flask web app that I need to distribute to many users. However, I can't install python on all those computers and there is no computer which everyone can access. And I cant serve the app internally from a server either. Yes, that's what I'm dealing with.
I have saved the git repo it in a network drive that everyone can access. I hoped I could run a batch file to spin the localhost server from a copied environment for the user and then use the web app.
I copied a conda environment over to the network drive and tried to use that but that gave me a Importing the numpy c-extensions failed error.
I tried including a pip environment (.\env) in the folder. So I thought any user could just activate the environment using the batch file ...
cd %cd%
.\env\Scripts\activate.bat
.\env\Scripts\python.exe run.py
but it's not working.
The .\env\Scripts\activate just crashes. I amended the activate.bat set "VIRTUAL_ENV=%cd%\env" to ensure it uses the current folder. Still crashes.
If I exclude that then .\env\Scripts\python.exe run.py still looks for a python installation at the path I have on my machine rather than the path I provided above.
Is there a solution to this?
All the computers will be using Windows but may vary between Windows 7 and Windows 10. I'm doing the development from my Windows 10 computer.
After activating venv My below code worked:
(Monday) C:\Users\Resurctova\Desktop\PoraPuski\Monday>python new.py
Output :
testing
since the new.py has code to print testing
As Monday is my venv I activated it and executed the script.
Do not execute in Scripts folder of your venv environment
Have you though about creating an exec file and that will save all your folders. Using a tool lik PyInstaller. You just need to share the output exe file without installing python.

Change the python executable that Django 1.7 loads

I am building an app on Google Compute Engine using Django 1.7 and Python 2.7 within a Debian environment.
To get the mpl_toolkit library to work I have had to install Anaconda and its various modules within that environment, thereby over-riding the default "out-the-box" Bitnami setup.
I am currently unable to get the live server to run python from the Anaconda directory (/home/beastflow/anaconda2/bin/python) as it needs to.
Indeed, when I load the page I get the following line as part of the debug message:
Python Executable: /opt/bitnami/python/bin/python
What do I have to change in order to get Django to point to /home/beastflow/anaconda2/bin/python ?
Ok I found an answer (which avoids having to rebuild mod_wsgi). If you're using Bitnami, you can get python to load from a different path by changing /opt/bitnami/apache2/bin/envvars by adding a PATH line as follows (for example):
PATH=/home/beastflow/anaconda2/envs/django17/bin/:$PATH
export PATH
Then restart the apache server:
sudo /opt/bitnami/ctlscript.sh restart

Importing and debugging a Python Django project made in a different environment

I am working on a Django project that was created by another developer on a different machine. I see that in the root of the application, there is a .virtualenv directory. Is it possible to simply setup this project locally on my Windows machine using the project settings and Python version (the app uses 2.7), so that I can run it like a local Django application so debugging is feasible?
I have access to the development web server and have copied the full source of the app down to my Win7 machine but cannot seem to get things setup correctly to run the app locally so I can debug.
I currently have Python 2.7, 2.7.5 and 3.3.2 installed on my local dev machine. I would call myself pretty new to Django and Virtualenv.
If anyone has any guidance on how I can get my environment straitened out so I can run the app with debugging, I would be very thankful.
Thank you in advance.
Using a virtualenv environment created on a different machine is not recommended. There are things hard-wired for the particular system it was created on, and some apps may have components compiled for that particular system.
You should create a new virtualenv environment on your machine, install dependencies and move the Django project there.
Note on installing dependencies - there might be a file named requirements.txt somewhere. If it's there and it's kept up to date you can install all the dependencies by running a single command while in your virtualenv:
pip -r requirements.txt install
If you can't find it ask the other developer to create it. He just need to do this inside his own environment:
pip freeze > requirements.txt
I once faced the same problem and it took me so much time to configure another environment that I eventually had to create a VM with the same version of OS and libraries. I then made a raw copy of the project and it worked fine.

Categories