Windows can't find localstack - python

I have some trouble to start and run localstack. I can install localstack relatively easy with "pip install localstack". This worked for me without problems. After the installation I tried to start localstack with "localstack start" but then windows tells me it can't find localstack.
The command "localstack" is either misspelled or could not be found.
I searched a lot and found out there are some similar problems. In one issue I found something that could eventually work for me. In this question. Because I never worked with python this is a little bit confusing for me. I tried this answer. I switched into the python scripts folder and run the command "py localstack start". Here it is interesting, that I get an error again, but this time windows recognizes localstack.
This here is the error
Traceback (most recent call last):
File "localstack", line 31, in <module>
from localstack.utils import cli
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\site-packages\localstack\utils\cli.py", line 4, in <module>
from localstack.services import infra
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\site-packages\localstack\services\infra.py", line 20, in <module>
from localstack.utils import common, persistence
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\site-packages\localstack\utils\common.py", line 5, in <module>
import pty
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\pty.py", line 11, in <module>
import tty
File "c:\users\gion rubitschung\appdata\local\programs\python\python37\lib\tty.py", line 5, in <module>
from termios import *
ModuleNotFoundError: No module named 'termios'
How can I start localstack just by typing "localstack start"?

Install the 0.9.0 version with:
python -m pip install localstack==0.9.0
(First you have to uninstall the latest one.)
From localstack's issues.

You can install it directly from the Commandeer App. It uses docker under the hood.

Another way to install Localstack on Windows is by using Docker. Here are the steps:
Install Docker. Instructions given in the post below:
https://softwaredevelopercentral.blogspot.com/p/blog-page_1.html
Pull the latest LocalStack Docker Image using the command below:
$ docker pull localstack/localstack
Start LocalStack using the command below:
$ docker run --rm -p 4566:4566 -p 4571:4571 localstack/localstack
All these instructions are mentioned in the blog post below:
https://softwaredevelopercentral.blogspot.com/p/how-to-install-localstack-on-windows.html

Related

trouble installing pip and or queue for python

I have apache ampps which comes with version 3.6.1 of python.
I was given various directions for installing pip.
None seemed to work.
For example,
link https://packaging.python.org/tutorials/installing-packages/
says that I can run:
python -m pip install -U pip setuptools
Get a whole bunch of errors. It might amount to: no module named queue.
Similar errors happen when I download the file they mentioned (get-pip.py) and run it from python.
Now, when I look at directions for installing queue, some point me to use pip. But when I try to install pip, it is complaining that queue is not there....
Hmmm...?
Now what?
ERROR:
File "C:\Users\Nima\AppData\Local\Temp\tmp1v2hpnae\pip.zip\pip\compat\__init__.py", line 11, in <module>
File "C:\Program Files (x86)\Ampps\python\lib\logging\config.py", line 30, in <module>
import logging.handlers
File "C:\Program Files (x86)\Ampps\python\lib\logging\handlers.py", line 28, in <module>
import queue
ModuleNotFoundError: No module named 'queue'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "getpip.py", line 20061, in <module>
main()
File "getpip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "getpip.py", line 82, in bootstrap
import pip
File "C:\Users\Nima\AppData\Local\Temp\tmp1v2hpnae\pip.zip\pip\__init__.py", line 26, in <module>
File "C:\Users\Nima\AppData\Local\Temp\tmp1v2hpnae\pip.zip\pip\utils\__init__.py", line 22, in <module>
File "C:\Users\Nima\AppData\Local\Temp\tmp1v2hpnae\pip.zip\pip\compat\__init__.py", line 13, in <module>
File "C:\Users\Nima\AppData\Local\Temp\tmp1v2hpnae\pip.zip\pip\compat\dictconfig.py", line 22, in <module>
File "C:\Program Files (x86)\Ampps\python\lib\logging\handlers.py", line 28, in <module>
import queue
ModuleNotFoundError: No module named 'queue'
From the format i see here.
Firstly, pip is an installer basically what you've confused yourself with is that pip = queue which is not the case. Pip is just a packager that helps you install packages. Queue is a different module
For your case here Queue is a part of multiprocessing module so you just put this at the top of your code:
from multiprocessing import Queue
and you do not need to add import pip into your code
hope that explained things better for you :)
This line:
python -m pip install -U pip setuptools
means use pip to upgrade the installations of pip and setuptools. Only works if you already have pip - which you probably do. It is a useful step to make sure your install environment is up to date, though.
pip does in places use queue. Note it's been renamed between python2 and python3 - if you have py3, which you claim, you have queue (it was Queue in py2). So I wonder if there's a version mismatch in something.
Windows installs always create problems. You might be safer installing and experimenting with a virtualenv so your experiments don't mess up the python install from the package you mention - ampps. There are plenty of notes on that elsewhere on stackoverflow... e.g. Python and Virtualenv on Windows
pip is already included in 3.6.1, but it is in subfolder Scripts.
it is not automatically a part of the path variable.
you have to change directory and run pip or you can change environment variable so that the location of pip becomes part of the path search.

Emacs, python: Run "sudo pip install names" to install

Emacs 24.5
Python 2.7.12
If I start simple (Hello world) python script from shell - is OK. But if start more difficult script then return error:
python myscript.py "some_params"
ATTENTION! https://pypi.python.org/pypi/names/ package is requred to randgen human names.
Run "sudo pip install names" to install.
Traceback (most recent call last):
File "myscript.py", line 6, in <module>
import secretary
File "my_another_script.py", line 5, in <module>
import names
ImportError: No module named names
You need to install the external libraries you are using. names in this case is an external library that you need to install to make your script work.

ImportError: No Module named 'driver' in pyttsx

I am trying to run a voice program in Python 3.5.2 and with pyttsx library. But I've faced up with lots of problems. First one is about engine. When I run the command import pyttsx, compiler gave me the error like below:
ImportError: No module named 'engine'
Then I've found this answer. But it didn't work either. Eventually, I now have another - similar - error like below:
D:\Users\orcuny\Desktop\AVA>python ava.py
Traceback (most recent call last):
File "D:\Users\orcuny\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyttsx\__init__.py", line 37, in init
eng = _activeEngines[driverName]
File "D:\Users\orcuny\AppData\Local\Continuum\Anaconda3\lib\weakref.py", line 131, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "ava.py", line 3, in <module>
engine = pyttsx.init()
File "D:\Users\orcuny\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyttsx\__init__.py", line 39, in init
eng = Engine(driverName, debug)
File "D:\Users\orcuny\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyttsx\engine.py", line 45, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "D:\Users\orcuny\AppData\Local\Continuum\Anaconda3\lib\site-packages\pyttsx\driver.py", line 64, in __init__
self._module = __import__(name, globals(), locals(), [driverName])
ImportError: No module named 'drivers'
As far as I can get from the answers all over the SO, I assume that pyttsx library is written in Python 2.X.
My first question is, how can I solve this above problem?
The second question is, I couldn't find pyttsx library which is written in Python 3.X. Can anybody enlighten me if there is any pyttsx library that is written in Python 3.X?
Thanks in advance.
EDIT:
Adding site-packages to my PATH variables also didn't work.
Well, the problem seems to be addressed in the following post
import pyttsx works in python 2.7, but not in python3
Can anybody enlighten me if there is any pyttsx library that is written in Python 3.X?
Yes, please use the following version:
https://github.com/jpercent/pyttsx
It is a Python3 port of pyttsx which seems to address the problems you face and targets Python 3.X versions.
For example the error you see (ImportError: No module named 'drivers') is addressed by the following commit
https://github.com/jpercent/pyttsx/commit/f035083338f39f7d93b0c610fbef0bb55fc9fc1c
which was merged in the aforementioned repository.
To install the pyttsx python module, you can
pip install git+git://github.com/jpercent/pyttsx.git
or
pip install git+https://github.com/jpercent/pyttsx.git
or
git clone https://github.com/jpercent/pyttsx.git
cd pyttsx
sudo python setup.py install
or do that inside a virtual environment if you use them. You can avoid using 'sudo' to install, depends on the environment you use and how you organized the packages (locations, etc.).
Of course, use the right python (python3) and pip (pip3) as you have in your environment.
Please remove and clean the previous pyttsx package you had there in the environment.
In addition, you can visit http://pyttsx.readthedocs.io/en/latest/install.html
for more details on that.
site-packages hasn't included your PY_HOME or PATH. Please open Enviroment Variables and add it to the System Variable.
Add something like below, also you will see required packages under the folder.
C:\where_your_python_installation\Lib\site-packages
Hope it helps
You can install
pyttsx3
which is compatible with both python3 and python2 and is error free as far as i have tested.
Install:
pip install pyttsx3
In CMD run this command it will remove all the issue ,
I just tried it.
pip install -Iv pyttsx3==2.6 -U

wxPython import error with Windows install

I have installed Python 3.4 and wxPython Phoenix on Windows 10. I go into Eclipse and add wxPython to the external libs in my project, but when I try to import it, I get this error:
Traceback (most recent call last):
File "C:\Users\linus\workspace\MiCS 1.2\main.py", line 1, in <module>
import wx
File "C:\Python34\Lib\site-packages\wx\__init__.py", line 17, in <module>
from wx.core import *
File "C:\Python34\Lib\site-packages\wx\core.py", line 6, in <module>
from ._core import *
ImportError: DLL load failed: The specified module could not be found.
I did some searching and tinkering and still can't figure out what's causing it. It shouldn't be the msvcp or msvcr DLLs as I have Office running just fine (or is that an incorrect assumption?) Any help is appreciated. Thanks.
How did you install wxpython?
As of now, the top page of the official site has wxpython 3.0 only for python27. So, I suspect you might not have installed it properly.
If you have your python34 at C:/Python34 then, cd to C:/Python34/Scripts first so that we make sure to use the pip for this python.
According to this post (https://groups.google.com/forum/#!topic/wxpython-dev/LmGIrQyh7jc), try
pip install -U --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
This should find the corresponding whl file for your python version and CPU architecture.
Or, you could manually download whl file at http://wxpython.org/Phoenix/snapshot-builds/
If you have 32 bit Python34, then look for ******-cp34-none-win32.whl
and simply do:
pip install path/to/the/whl/that/you/just/downloaded/wxPython_Phoenix-3.0.3.dev1839+4ecd949-cp34-none-win32.whl
After this, if you can import wx in the normal cmd then the problem should be coming from eclipse.

AttributeError: 'module' object has no attribute 'wraps'

I am trying to get Django running on a shared hosting account for which I have ssh access, but I have been having issues getting it working. When I first tried running django-admin.py, I received an error about the module 'functools' being missing. I had the hosting company install the functools package, but now I get the following traceback when I try to run django-admin.py.
Traceback (most recent call last):
File "manage.py", line 2, in <module>
from django.core.management import execute_manager
File "/usr/local/lib/python2.6/site-packages/Django-1.3-py2.6.egg/django/core/management/__init__.py", line 3, in <module>
from optparse import OptionParser, NO_DEFAULT
File "/usr/local/lib/python2.6/optparse.py", line 90, in <module>
from gettext import gettext
File "/usr/local/lib/python2.6/gettext.py", line 49, in <module>
import locale, copy, os, re, struct, sys
File "/usr/local/lib/python2.6/locale.py", line 98, in <module>
#functools.wraps(_localeconv)
AttributeError: 'module' object has no attribute 'wraps'
I opened a support ticket and was told by the company that they reinstalled Python 2.6, but that didn't change anything. I also tried with 2.4, which is also installed on the machine, but that resulted in the earlier ImportError: No module named functools error.
Does anybody have any ideas?
A likely cause is something shadowing the stdlib functools module. Do you have a functools.py alongside the main script (manage.py)? See what import functools; print functools.__file__ prints, inside manage.py (before any of the other imports.) If it doesn't print /usr/local/lib/python2.6/functools.py, there's probably a file shadowing the standard library module. If it does print that, something is wrong with that file, reinstalls notwithstanding.
this solution worked for me .
mv /usr/lib/python2.7/site-packages/pip* ./
yum reinstall python-pip
sudo pip install django
or try an another solution .
its too risky and this might not be a safest solution.but it worked fine for me .
uninstall pip.
pip uninstall pip
if you installed by get-pip.py .
python -m pip uninstall pip setuptools
navigate to the path.
/usr/lib/python2.7/site-packages/
and find out two pip directories pip and pip-6.0.8.dist-info.
remove both pip and pip-6.0.8.dist-info.
then try again.
yum install python-pip
or
python get-pip.py

Categories

Resources