Starting localstack fails - missing termios - termios

termios appears to be a Python module required for localstack. Installing on my Windows machine using pip fails. Further research reveals this is only available on UNIX systems. What is the Windows workaround? I prefer to not go the Docker route - hyperthreading issues if I remember correctly.
My current environment:
Windows 10 (64-bit)
make 3.79.1
python 3.6.1
pip 19.1
npm 5.6.0
java 1.8.0_211
javac 1.8.0_45
mvn 3.6.1
> python localstack start
Traceback (most recent call last):
File "localstack", line 30, in
from localstack.utils import cli
File "C:\Program Files\Python36\lib\site-packages\localstack\utils\cli.py", line 4, in
from localstack.services import infra
File "C:\Program Files\Python36\lib\site-packages\localstack\services\infra.py", line 20, in
from localstack.utils import common, persistence
File "C:\Program Files\Python36\lib\site-packages\localstack\utils\common.py", line 7, in
import pty
File "C:\Program Files\Python36\lib\pty.py", line 11, in
import tty
File "C:\Program Files\Python36\lib\tty.py", line 5, in
from termios import *
ModuleNotFoundError: No module named 'termios'

You should use docker to install localstack. It is their preferred method. That said, if you download the Commandeer Desktop App, it has an install process that uses docker under the hood and has a nice UI for managing LocalStack.

Related

Python 3.9 import issue

I just installed Python 3.9 with the Windows 64-bit installer. For some reason the all of the modules I had previously installed using pip will no longer import, unless I am running Python from the directory where they are located: C:\Users\<user>\AppData\Local\Programs\Python\Python38-32\Lib\site-packages
I tried uninstalling/reinstalling the requests module with pip and then importing requests in a shell, still not recognized.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'
I imagine this is probably some environmental variable path issue. I'm new to Python, any help getting this straightened out much appreciated.
Each version of python has its own global sites package directory where it stores the packages you install.
Ex: Python 3.8 will store under %appdata%\Local\Programs\Python\Python38-32\Lib\site-packages
Python 3.9 would store it in a different location (like Python39-32)
In order to install a package for specific version of python you need to install it with python version command.
py -3.9 -m pip install requests
You can refer the official documentation here

Python3 cannot find statsmodels.api but I can and so can my linter

I recently got into development with Python running on WSL (Ubuntu 18.04 LTS).
I followed the documentation from here and I'm able to run simple python scripts.
I started playing around with libraries that I installed using the pip3 command such as numpy and pandas and these work fine.
The problem arises when I try to use the statsmodels package.
I've installed it using pip3 install statsmodels
I can see the package in /home/username/.local/lib/python3.6/site-packages/statsmodels I can even see the api.py file in that directory, however, when I type import statsmodels.api as sm as recommended on the statsmodels website I get:
Console output:
username#DESKTOP-1JP4BIE:/mnt/c/users/username/dev/project/playground$ python3 statsmodels.py
Traceback (most recent call last):
File "statsmodels.py", line 5, in <module>
import statsmodels.api as sm
File "/mnt/c/username/chris/dev/project/playground/statsmodels.py", line 5, in <module>
import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels.api'; 'statsmodels' is not a package
I've tried uninstalling and reinstalling (did not work)
I really can't see anything that differentiates this package from the others that I've installed. Does anyone have any insights?
Thanks #Vorsprung durch Technik
The issue was that my file name was statsmodels.py.
I'll remember to be more careful when naming my python files.

Using pip 10.0.1 to install modules

lately using 9.0.1, I have been using Project Interpreter to import modules for my files. I opened up a new project in PyCharm today to try and test 10.0.1. Using the Pip version of 10.0.1, I couldn't install packages into my file.
The command output was :
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\packaging_tool.py", line 192, in main
retcode = do_install(pkgs)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\packaging_tool.py", line 109, in do_install
return pip.main(['install'] + pkgs)
AttributeError: module 'pip' has no attribute 'main'
I googled this and it said that installing modules through pip was now unsupported, especially for
pip._internal.main
After looking at this site : https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program for a while, it says to use :
subprocess.check_call([sys.executable, '-m', 'pip', 'install', 'my_package'])
I tried executing it and command prompt said that subprocess.check_call is not an internal or external file.
i also tried executing the commands through Command Prompt and downgrading my pip to 9.0.1 but none of this worked. When I changed Pip to 9.0.1 in Command Prompt, it had no effect on PyCharm.
Can anyone help with trying to import modules into PyCharm because I am currently trying to make a webcrawler using modules beautifulsoup4 and it is not letting me import it.

Scipy installation windows 10

I have some difficulties trying to install Scipy for Python 3.5 on a Windows 10 machine and I hope I can find some help here. So here is what I have done so far.
I have downloaded the numpy+mkl for python 3.5 and 64bit version as well as the scipy0.18.1 for the same versions, from Gohlke's website
I installed the numpy+mkl whl with:
python -m pip install numpy-1.11.2+mkl-cp35-cp35m-win_amd64.whl
all goes well.
then I install the scipy package the same way like:
python -m pip install scipy-0.18.1-cp35-cp35m-win_amd64.whl
This also completes.
However, when I try to run python afterwards I get the following error:
Fatal Python error: Py_Initialize: can't initialize sys standard streams
Traceback (most recent call last):
File "C:\Python35\Lib\site-packages\scipy\io\__init__.py" , line 97, in <module>
File "C:\Python35\Lib\site-packages\scipy\io\matlab\__init__.py", line 13 in <module>
File "C:\Python35\Lib\site-packages\scipy\io\matlab\mio.py", line 8 in <module>
ImportError: No module named 'numpy'
I also get a pop-up that Python has stopped working.
I have tried a different order in which I installed the packages, but all lead to the error mentioned when Scipy is installed.
I also installed did this on a windows 7 machine and there it works.
Does anybody have any idea what causes this issue?
I also had some issues. So I just installed Anaconda3 insted of python directly.

Running 'docker-compose up' raises "No module named fnctl" error on Windows

Setup:
Windows 7
Docker v1.6.0, installed as part of Boot2docker
Docker-compose v1.2.0
I installed docker-compose using pip:
pip install docker-compose
And it seemed to install successfully. However, when I try to run: docker-compose up in the directory in which I have my docker-compose.yml definition, I get the following exception:
Traceback (most recent call last):
File "c:\Python27\Scripts\docker-compose-script.py", line 9, in <module>
load_entry_point('docker-compose==1.2.0', 'console_scripts', 'docker-compose
')()
File "c:\Python27\lib\site-packages\pkg_resources.py", line 351, in load_entry
_point
return get_distribution(dist).load_entry_point(group, name)
File "c:\Python27\lib\site-packages\pkg_resources.py", line 2363, in load_entr
y_point
return ep.load()
File "c:\Python27\lib\site-packages\pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "c:\Python27\lib\site-packages\compose\cli\main.py", line 11, in <module>
import dockerpty
File "c:\Python27\lib\site-packages\dockerpty\__init__.py", line 17, in <modul
e>
from dockerpty.pty import PseudoTerminal
File "c:\Python27\lib\site-packages\dockerpty\pty.py", line 21, in <module>
import dockerpty.io as io
File "c:\Python27\lib\site-packages\dockerpty\io.py", line 18, in <module>
import fcntl
ImportError: No module named fcntl
I understand from different posts unrelated to docker that this error is thrown because fcntl is linux native and, obviously, my python windows distribution is missing it. However, the workarounds the people there specified don't necessarily apply to my personal case.
I also tried the steps here: https://github.com/docker/compose/releases
I downloaded the linux archive using curl (had no uname resolution) and gave execution right, but still:
$ docker-compose -version
./docker-compose: ./docker-compose: cannot execute binary file
Is anyone aware of any workarounds / actually functional ways of installing docker-compose on a Boot2docker VM?
You can run docker compose on boot2docker Windows.
You can install docker compose in a container directly in boot2docker and use it that way.
See "How to install docker-compose on Windows and issue 1085.

Resources