My python installation on 1and1 stopped working (bashrc issue) - python

I installed python 2.7.10 on my 1and1 linux hosting service about 8 months ago (using instructions from http://geeksta.net/geeklog/python-shared-hosting/) and everything was working fine (I had a daily cron job that would call my python script). But recently,my python script stopped working and it appears that the call to python itself is the culprit, rather than the python code. Whenever I type 'python' into the command line in the 1and1 unix ssh session now, i get the following error message
"-bash: /kunden/homepages/26/xxxxxxxxxx/htdocs/python27/bin/python: No
such file or directory"
It's been awhile since I installed things, but I don't believe I had this issue previously. I'm trying to figure out why it's not working and what I can do to get it fixed. It appears that calling python isn't working properly (which would affect my script as well).
Any help with getting this working would be greatly appreciated.

when you type python, system find it in /kunden/homepages/26/xxxxxxxxxx/htdocs/python27/bin/python, but there is no such a file in fact.
what you need to do is trying to locate your python binary executable file, and alias your python to your file

I ended up just reinstalling python 2.7 again and it works again. Not sure why it stopped working before.
Now I can type "python" in the command line and it starts the Python console.

Related

Python is searching in the wrong user folder

I am running a python script with Process.Start from c#. The program works correctly on my main PC however when I try to run it on another computer it comes up with this error:
No Python at 'C:\Users\[User name on main Pc ]\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe'
How could I solve this?
It seems that Python is not installed on the other PC. That's why your script is not working. You need to install Python first, so your PC is able to interpret your code.

Executing command line program (Abaqus-python script) from python script

I am trying to run an Abaqus-python script file from another python script executed in Spyder (python 3.7, windows 10).
If I run the following command in CMD
abaqus cae -noGUI model.py
the code executes as expected. However, if I try to run cp = subprocess.run('abaqus cae -noGUI model.py',shell=True)
I don't get any output. Below is what is returned in cp.
Notes:
The Abaqus-python file I am trying to run is in the same folder as the python script I have.
I have tried various sp.call, sp.run, os.systems in different string and list formats.
"C:\Abaqus\Commands" and "C:\SIMULIA\Commands" are both in my PATH environment variable.
I think the -noGUI call is important to the problem. I can't seem to find others on SO with this issue.
After a fair amount of digging, I think the issue is that the PATH for my python install is done thought Anaconda so I have a different path this vs CMD. I fixed this by adding the full Abaqus location to the command. See below.
subprocess.call(r'C:\SIMULIA\Commands\abaqus job=Job-1 ask_delete=OFF interactive', shell=True)
I am not sure what your problem is due to, but note that Abaqus scripting is based on python 2.7, therefore you might need to downgrade it

Why isn't my PythonScript for Notepad++ running?

I'm running NPP 6.3.1 (UNICODE) and the current pythonscript plugin (python 2.7.6, pythonscript 0.9.2.0)
I recently got a new machine and had to reinstall both NPP and PythonScript (PS). I wrote a basic script a little while ago and had been using it a good bit and it worked fine using the PS plugin.
I installed everything and run the script through the PS plugin menu but nothing happens. I try it again and now, I keep getting the following error:
Another script is currently running. Running two scripts at the same time could produce unpredictable results, and therefore is disabled.
The script is designed to search the document and find the next available point number and insert it at the cursor. Like I said, it's a simple script that has a defined start and end. I've never had a problem with it before. So, I decided to create a new script (test.py) which consists entirely of the following:
console.write("test")
Nothing. The console doesn't show any activity no matter what I do, which leads me to believe that the script isn't even starting, even though it says that it loads up (in 16ms) and says its ready...
I tried uninstalling everything and reinstalling but still nothing. I haven't tried previous versions yet.
Am I missing something stupid?
The problem was that I did not have the most current version. After installing version 6.6.6 and PythonScript 1.0.2, it works.
Just want to leave this information for the next people who come in with this problem.

How can I run python3 on my apache server by default?

I am a beginner to Python here, and I am having an issue.
In my setup, I was using a PHP script to call the command line which in turn would execute a python script. Since then, I've discovered that I can run python directly.
My problem is that 2.6 is running when I call the script directly, and I need Python 3.3 to run instead.
After looking this up, I found I need to recompile mod_python, but then I found that I want to use mod_wsgi instead which is giving me a whole series of other errors like my python3 installation not having --shared-libraries when make was ran.
I am pulling my hair out trying to do such a seemingly simple task. Is there any direction someone can point me in? Again, I am a Python beginner. Any help is apprecited!

How to install python 3.2.3 on Windows 7 enterprise

although I have been using python a long time very easily in a Linux environment, I have tremendous trouble to even install it correctly in a windows environment. I hope this is a question to be asked here, as it is not directly a programming question.
Especially, I have the following problems:
When on the command line, python is not a recognized command. Do I have to set the Windows path manually myself? If so, how to do that?
When starting a python script, should this be done with python.exe or pythonw.exe? What is the difference?
I also tried to install ipython several times, it never got installed (even after following the starting ipythonenter link description here thread.
When starting a script with python.exe, a window pops up and closes immediately. I saw some hints in putting in a readline command, which is of no help if there is a syntax error in the script. So how to be able to keep the window open, or how to run the command on the cmd.exe?
Thank you for any help on these items.
Alex
1) Look here: www.computerhope.com/issues/ch000549.htm
2) It has already been answered, always try to use search before asking question:
pythonw.exe or python.exe?
4) When using cmd.exe just navigate to your script folder using dir for changing directories and C:,D:,etc. for changing drives. Then run script by typing just the script name. When installed correctly, Python automatically launches .py scripts with python, so you don't have to write 'python' before script name. When run in cmd, window will stay open. If you want it to stay open even when launching script with double-click, use function waiting for user input, see here How to keep a Python script output window open?
You might want to use Python3.3, there is a new launcher for Python scripts in it. By that, you can start Python scripts with py <scriptname> which has the benefit of being installed in your path (C:\Windows\system32) and you can use a shebang to tell whether the script is for Python2 or Python3.
Also
In addition to the launcher, the Windows installer now includes an
option to add the newly installed Python to the system PATH
(contributed by Brian Curtin in issue 3561).

Categories