How do I send a mail via mailx & subprocess?

I am EE, trying to write a script to simplify file checks using Python. For some reason, our IT will not let me gain access to our SMTP server, and will only allow sending mail via mailx. So I've...

How come string.maketrans does not work in Python 3.1?

I'm a Python newbie. How come this doesn't work in Python 3.1? from string import maketrans # Required to call maketrans function. intab = "aeiou" outtab = "12345" trantab = maketrans(intab,...

changing python path on mac?

I would like to change my PATH from Python 2.6.1 to 3.1.2. I have both versions installed on my computer, but when I type python --version in the terminal I get Python 2.6.1. So, thats the...

sys.argv[1] meaning in script

I'm currently teaching myself Python and was just wondering (In reference to my example below) in simplified terms what the sys.argv[1] represents. Is it simply asking for an...

How to run web2py in ubuntu?

I downloaded the source code package from http://web2py.com/examples/default/download , but I can't start web2py using this command: [email protected]:~/web2py$ python web2py.py -a 'your password' -i...

sys.argv as bytes in Python 3k

As Python 3k introduces strict distinction between strings and bytes, command line arguments in the array sys.argv are presented as strings. Sometimes it is necessary to treat the arguments as...

Size of list in memory

I just experimented with the size of python data structures in memory. I wrote the following snippet: import sys lst1=[] lst1.append(1) lst2=[1] print(sys.getsizeof(lst1),...

How to set Python version by default in FreeBSD?

I'm trying to install the application node, but by default in my environment is python 3, and requires python 2.6. How can I change the default python version in FreeBSD? # cd /usr/local/bin # ls...

Why photoimages don't exist?

I will show a reduced portion of the code that gives me a problem. _tkinter.TclError: image "pyimageN" doesn't exist - where N stays for 1, 2, 3, etc... There is a first class that shows a menu...

Syntax error with basic Python 3 issue

Possible Duplicate: Syntax error on print with Python 3 I know Python is supposed to be the god of interpreted languages... its simplicity, its lack of redundancy, blah blah blah. But since I'm...

make *** no targets specified and no makefile found. stop

I have a problem installing package dionaea. After I type this: ./configure --with-lcfg-include=/opt/dionaea/include/ \ --with-lcfg-lib=/opt/dionaea/lib/ \ --with-python=/opt/dionaea/bin/python3.1...

Why does next raise a 'StopIteration', but 'for' do a normal return?

In this piece of code, why does using for result in no StopIteration or is the for loop trapping all exceptions and then silently exiting? In which case, why do we have the extraneous return?? Or...

Installation of pysftp via pip failed (because of 2 python2.x versions?)

My Ubuntu 10.04 came with Python 2.6. Now, I also installed Python 2.7, which is the system default now because when I start python from the terminal, it starts python 2.7. Now, I want to install...

Error: Missing the OpenSSL lib? while trying to install python

I have tried installing python in pyenv env, in which i am getting the below error. I have added openssl to the path variable as openssl is already available, still it is throwing the same...

Cross-Compiling Boost on Windows for Raspberry Pi using SysGCC Toolchain and MinGW

I currently trying to cross-compile Boost 1.64.0 on Windows 7 (64bit) for the Raspberry Pi (running Jessie) using the Raspberry SysGCC 4.9.2 Toolchain and MinGW 6.3.0. I installed everything to...

Local Conda installation failing due to permissions on shared hosting

Is there a way to create a local installation of conda in a completely portable way that will handle all dependencies not currently linkable on the system? I had thought I could create an...

Python 3 install location

I am using Ubuntu 16.04 . Where is the python 3 installation directory ? Running "whereis python3" in terminal gives me: python3: /usr/bin/python3.5m-config /usr/bin/python3 /usr/bin/python3.5m...

pip on a Mininet host cant find installed packages

I have Mininet on a VM, I installed a package called wsproto using pip, but when I try to use that package from inside a Mininet host I get an error indicating that the package is...

Python3: Module not found

I have installed numpy but shell says it is not installed. I have multiple python3 versions installed. I know it has to do something to point to the correct path, but I don't know how to do it....

how to temporarly change default python3 path

I am running meson build which requires a number of python3 libraries to be installed. On my system a default python3 installation is currently pointing to $ which...

Import runtime installed module using pip in python 3

I want to install and import Python 3 modules at runtime. I'm using the following function to install modules at runtime using pip: def installModules(modules): for module in...

Need to install Python3 after installing anaconda3 and python2.7

Currently, I have anaconda3 installed on my Mac, and I am using python 2.7 also. But I am trying to see if I can use python 3.1 as an alternative. When I check the environments using the...

How to install Python on Mac through Pyenv?

I want to install python 3.4.2 on Mac 10.15.1 I have run: $ pyenv install 3.4.2 but appears the error: Ignoring ensurepip failure: pip 1.5.6 requires SSL/TLS searching i have found this link...

Ignoring ensurepip failure: pip requires SSL/TLS - Python 3.4.X with pyenv on OS X

I am trying to install python version 3.4.10 via pyenv but I get the error Ignoring ensurepip failure: pip 9.0.1 requires SSL/TLS. For python versions after 3.4.10 (e.g.: 3.5.9), it did succeed...

How can I install Python 3.7 on an old centos shared web host (without root)?

I want to install Python 3.7 on a web hosting server that is live (production) without disturbing anything. I have SSH terminal access and I guess the server is running centos from the following...

VS Code Setup, cannot find python 3

I have been trying to make vscode work for centuries now it seems, but i cant seem to make it work. I installed python extenion on vscode. This is settings.json { "python.pythonPath":...

Switching Python version (3.9 → 3.8) installed by Homebrew

It’s a very similar situation like described here, but vice versa. I have Python 3.8 installed via Homebrew and updated that to 3.9: % brew list --formula | grep python [email protected] [email protected] I...

How to change pythonpath to use python 3.9 and venv

I am trying to get to grips with Python on my Mac running OSX 10.15.7 Catalina. My goal is to be able to run a program requiring python 3.9 and associated libraries, in its own virtual...

macOS brew hangs on building [email protected] (3.9.1_7)

When I try to upgrade [email protected] on my brew installation, the installation formula hangs. I see it hangs at [19/43] test_functools but there are many "failed (env changed)" and a few malloc...

Can't install any Pyenv python versions

Sorry for the noobie question but Im so lost. Im currently running osx 11.5.2, Pyenv 2.2.2, homebrew 3.3.5 I installed Pyenv via Homebrew, at first I was able to install 3.10.0 with pyenv install...