Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
hooah
Feb 6, 2006
WTF?
I'm going through a Docker course on Udemy, and the instructor provides this Flask app. Unfortunately, it doesn't seem to run, neither in a Docker container nor by itself. Here's the stack trace from the container:

code:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
    sock = self._connect()
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 464, in _connect
    socket.SOCK_STREAM):
  File "/usr/local/lib/python3.5/socket.py", line 733, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/redis/client.py", line 572, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
    self.connect()
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error -5 connecting to redis:6379. No address associated with hostname.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 439, in connect
    sock = self._connect()
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 464, in _connect
    socket.SOCK_STREAM):
  File "/usr/local/lib/python3.5/socket.py", line 733, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -5] No address associated with hostname

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "app.py", line 7, in <module>
    cache.set(default_key, "one")
  File "/usr/local/lib/python3.5/site-packages/redis/client.py", line 1072, in set
    return self.execute_command('SET', *pieces)
  File "/usr/local/lib/python3.5/site-packages/redis/client.py", line 578, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 563, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 538, in send_packed_command
    self.connect()
  File "/usr/local/lib/python3.5/site-packages/redis/connection.py", line 442, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error -5 connecting to redis:6379. No address associated with hostname.
The local stack trace is the same except the error numbers are 11001 instead of -5. What's going on? I'm reasonably familiar with Python, but haven't touched Flask ever.

Adbot
ADBOT LOVES YOU

SurgicalOntologist
Jun 17, 2004

Looks like it expects redis to be running. Install redis and run it.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

This isn't going to be too helpful, but that's not exactly a Python issue. Your computer can't find the ip for the hostname that's configured somewhere in that app.

Dex
May 26, 2006

Quintuple x!!!

Would not escrow again.

VERY MISLEADING!
it's expecting you to use the compose file - the redis container's address would then be resolved as 'redis', since that's its name, in this bit:

quote:

redis.exceptions.ConnectionError: Error -5 connecting to redis:6379. No address associated with hostname.

hooah
Feb 6, 2006
WTF?

SurgicalOntologist posted:

Looks like it expects redis to be running. Install redis and run it.

The Dockerfile includes a command to install redis 2.10.5. I also installed the latest version on my local, and got the same result.

Dex posted:

it's expecting you to use the compose file - the redis container's address would then be resolved as 'redis', since that's its name, in this bit:

Sorry, the "compose file"? What's that?

2nd Rate Poster
Mar 25, 2004

i started a joke
Nevermind

Dex
May 26, 2006

Quintuple x!!!

Would not escrow again.

VERY MISLEADING!

hooah posted:

The Dockerfile includes a command to install redis 2.10.5. I also installed the latest version on my local, and got the same result.

actually that command(https://github.com/jleetutorial/dockerapp/blob/master/Dockerfile#L2) is installing the python redis client, not a redis server

quote:

Sorry, the "compose file"? What's that?

this thing: https://github.com/jleetutorial/dockerapp/blob/master/docker-compose.yml

docker-compose lets you orchestrate multiple containers spinning up, and it handles linking them automatically. when you link containers in docker, you can resolve them by container name. see here: https://docs.docker.com/compose/install/#install-using-pip

basically, instead of running that app locally or building that dockerfile directly, you should be running "docker-compose up" in that repo. this would then start up the flask app and a redis server for it to talk to

so, the actual error message you're encountering is that the flask app is searching for redis:6379. 'redis' there is a hostname, specifically in this case the hostname of a separate container running a redis server. the application and dockerfile are both written with the expectation that the hostname 'redis' will resolve to a an address where a redis server is running(https://github.com/jleetutorial/dockerapp/blob/master/app/app.py#L6) - this is why trying to run it locally will get you nowhere unless you add 'redis' to your hosts file, or change the code to point to localhost or something

docker-compose is written in python so i suppose it's technically relevant to this thread, but probably not. is there a docker thread anywhere?

edit: note i haven't actually pulled down that repo to try it since i'm on my windows laptop so this is all guesswork. i have worked with docker a fair bit though

Dex fucked around with this message at 20:41 on Jun 3, 2017

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I've been asking (and see other people asking as well) my docker questions in the Linux thread so maybe try there. It's more active than this one as well.

LochNessMonster
Feb 3, 2005

I need about three fitty


I just ditched PyCharm because I couldn't really get used to it and installed anaconda on my work laptop (windows 10).

Now I tried to install some packages but nothing seems to be doing anything.

Conda list or search din't return anything so I'm wondering what I'm doing wrong here. Anyone run into this before?

Dominoes
Sep 20, 2007

PyCharm and Anaconda aren't mutually exclusive.

I apologize if I'm saying things you know already, but would you please describe exactly what steps you did to install the packages, then use them? To install packages, do this:

code:
conda install numpy

# or, 

pip install numpy
You can check which packages are installed by using this:

code:
pip freeze 

# or

pip list

# or

conda list  # Which you said you tried.
Note that conda includes many packages by default

Import and use packages like this:

Python code:
import numpy as np

np.linspace(0, 1, 100)
I think one of Anaconda's downsides is the confusion over having two separate package managers. I'm hoping this is easy to troubleshoot; you're on windows, so you don't need to worry about having 3 separate versions of Python installed.

Dominoes fucked around with this message at 13:38 on Jun 4, 2017

LochNessMonster
Feb 3, 2005

I need about three fitty


I'm aware PyCharm/Anaconda are not mutually exclusive. I just didn't really like PyCharm as and IDE; it's too much for a starter like me. When installing PyCharm I also installed Python 3.6 manually. I uninstalled both of these before installing Anaconda (which has Python packaged with it right?). I didn't get any error messages while installing so I assume it succeeded.

When running the Anaconda prompt (as administrator) this is the output I get:

code:
(E:\Tools\Anaconda) C:\WINDOWS\system32>conda list

(E:\Tools\Anaconda) C:\WINDOWS\system32>conda search hmac

(E:\Tools\Anaconda) C:\WINDOWS\system32>conda search requests

(E:\Tools\Anaconda) C:\WINDOWS\system32>
If Anaconda doesn't come packaged with Python that's probably my problem.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

LochNessMonster posted:

I just ditched PyCharm because I couldn't really get used to it and installed anaconda on my work laptop (windows 10).

This is a weird thing to say, so just to make sure you didn't accidentally type the wrong thing...you know that PyCharm is an IDE and Anaconda is a package manager?

huhu
Feb 24, 2006

Thermopyle posted:

This is a weird thing to say, so just to make sure you didn't accidentally type the wrong thing...you know that PyCharm is an IDE and Anaconda is a package manager?

I could see Pycharm being overwhelming if you've never programmed before. Perhaps better to start off with something more familiar feeling first like Sublime Text. That being said, I moved from Sublime to Pycharm in my learning progression and never plan to go back.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

huhu posted:

I could see Pycharm being overwhelming if you've never programmed before. Perhaps better to start off with something more familiar feeling first like Sublime Text. That being said, I moved from Sublime to Pycharm in my learning progression and never plan to go back.

Right. But using or not using Anaconda doesn't have anything to do with PyCharm.

Dominoes
Sep 20, 2007

LochNess - I don't know what the Anaconda prompt is, but by default, the Anaconda installer should add Python and related tools (pip, jupyter qtconsole etc) to your system path, exposing them to a normal terminal. Anaconda does include Python. If these aren't set up, do this: press winkey, type 'environment', press enter, click 'Environment Variables', edit Path, and add your Python scrips path... Someone who's using Ananconda can tell you what it is; for stock python, it's something like 'C:\Users\UserName\AppData\Local\Programs\Python\Python36\Scripts'.

Open powershell or command prompt. Type 'pip list' or 'conda list'. What do you see?

LochNessMonster
Feb 3, 2005

I need about three fitty


I see I might have worded things a bit strange. I know Anaconda is a package manager. I replaced PyCharm and am going to try Spyder, which is bundled with Anaconda. If I don't like that I'll go back to Atom.

I did use PyCharm to manage the packages of my vanilla python install. So to manage my packages now I tried Anaconda as that seems to get recommended as package manager.

None of the commands (search / list / install ) give any output at all. Just a blank line and then a new prompt.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Sounds like it's not installed properly. Did you actually install it to System32?

Anaconda includes Python and when you install it you can choose to make it the default Python installation for the system - so whenever you run python bla.py it'll use the one in your Anaconda folder and have access to all the packages you installed there etc. Personally I'd just uninstall it and try again, following these instructions - I think the default install location is under AppData

Dominoes
Sep 20, 2007

LochNessMonster posted:

None of the commands (search / list / install ) give any output at all. Just a blank line and then a new prompt.
Did you do what I suggested? This should not happen; if there's an install or path problem, your output should be this:

code:
pip : The term 'pip' is not recognized as the name of a cmdlet, function...
Since you're trying to use spyder... What happens if you type 'spyder3' (or 'spyder'; not sure how Anaconda configures it) in powershell?


Do this exactly:
-Press the win key
-type 'powers'; press enter
-type 'pip list'; press enter
-Post the output here.

Dominoes fucked around with this message at 16:50 on Jun 4, 2017

Sockser
Jun 28, 2007

This world only remembers the results!




Not strictly a python question, I suppose, but I'm trying to build some code to read input from multiple connected mouses (right now 2, but later on it's going to be 4)

All of the python libraries I can find for interacting with mouse input seem to just read the cursor position, which is moot if I've got four trackballs controlling one cursor. I did find this super-beta library called inputs but I'm not sure if it even works right? It lags the gently caress out of my cursor and also kinda shifts the cursor on it's own so it's basically impossible for me to debug anything while that library is listening for events.


Worst case I just switch all my development over to linux and worry about reading device files but it'd be nice if I could continue to work on my windows box. Anyone got any suggestions here, hopefully a library that does what I need?

edit: going to try this

Sockser fucked around with this message at 20:01 on Jun 4, 2017

LochNessMonster
Feb 3, 2005

I need about three fitty


Dominoes posted:

LochNess - I don't know what the Anaconda prompt is, but by default, the Anaconda installer should add Python and related tools (pip, jupyter qtconsole etc) to your system path, exposing them to a normal terminal. Anaconda does include Python. If these aren't set up, do this: press winkey, type 'environment', press enter, click 'Environment Variables', edit Path, and add your Python scrips path... Someone who's using Ananconda can tell you what it is; for stock python, it's something like 'C:\Users\UserName\AppData\Local\Programs\Python\Python36\Scripts'.

Open powershell or command prompt. Type 'pip list' or 'conda list'. What do you see?

Was phone posting so didn't do this until just now. pip/spyder/conda commands now run from Powershell but not from the Anaconda Prompt. There's an option in the Anaconda installer that asked me if I wanted to add the scripts dir to the PATH, but it was recommended not doing so (so I didn't). The weird thing is, that it doesn't work in the Anaconda prompt itself. Same behaviour as before adding it to the path. Same thing happend in powershell but after restarting powershell it worked there. Restarting the anaconda prompt didn't solve so I think there's something not completely right. I think I'll just reinstall.


baka kaba posted:

Sounds like it's not installed properly. Did you actually install it to System32?

Anaconda includes Python and when you install it you can choose to make it the default Python installation for the system - so whenever you run python bla.py it'll use the one in your Anaconda folder and have access to all the packages you installed there etc. Personally I'd just uninstall it and try again, following these instructions - I think the default install location is under AppData

I installed in a different location than default. Guess reinstalling is quickest way to fix this.


Dominoes posted:

Did you do what I suggested? This should not happen; if there's an install or path problem, your output should be this:

code:
pip : The term 'pip' is not recognized as the name of a cmdlet, function...
Since you're trying to use spyder... What happens if you type 'spyder3' (or 'spyder'; not sure how Anaconda configures it) in powershell?


Do this exactly:
-Press the win key
-type 'powers'; press enter
-type 'pip list'; press enter
-Post the output here.

My previous post was posted from phone so I didn't do that yet.

It works in powershell but not in anaconda prompt so I guess something went wrong while installing. I'll fix that by trying to reinstall.


Thanks for the good advice all.


edit:

reinstalled in default path.

Conda still doesn't seem to do anything, pip does however.

code:
(C:\ProgramData\Anaconda3) C:\Users\LNM>conda list

(C:\ProgramData\Anaconda3) C:\Users\LNM>conda search requests

(C:\ProgramData\Anaconda3) C:\Users\LNM>conda search

(C:\ProgramData\Anaconda3) C:\Users\LNM>pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
alabaster (0.7.10)
anaconda-client (1.6.3)
anaconda-navigator (1.6.2)
anaconda-project (0.6.0)
asn1crypto (0.22.0)
astroid (1.4.9)
astropy (1.3.2)
Babel (2.4.0)
backports.shutil-get-terminal-size (1.0.0)
beautifulsoup4 (4.6.0)
bitarray (0.8.1)
blaze (0.10.1)
bleach (1.5.0)
bokeh (0.12.5)
boto (2.46.1)
Bottleneck (1.2.1)
certifi (2017.4.17)
cffi (1.10.0)
chardet (3.0.3)
click (6.7)
cloudpickle (0.2.2)
clyent (1.2.2)
colorama (0.3.9)
comtypes (1.1.2)
conda (4.3.21)
contextlib2 (0.5.5)
cryptography (1.8.1)
cycler (0.10.0)
Cython (0.25.2)
cytoolz (0.8.2)
dask (0.14.3)
datashape (0.5.4)
decorator (4.0.11)
distributed (1.16.3)
docutils (0.13.1)
entrypoints (0.2.2)
et-xmlfile (1.0.1)
fastcache (1.0.2)
Flask (0.12.2)
Flask-Cors (3.0.2)
gevent (1.2.1)
greenlet (0.4.12)
h5py (2.7.0)
HeapDict (1.0.0)
html5lib (0.999)
idna (2.5)
imagesize (0.7.1)
ipykernel (4.6.1)
ipython (5.3.0)
ipython-genutils (0.2.0)
ipywidgets (6.0.0)
isort (4.2.5)
itsdangerous (0.24)
jdcal (1.3)
jedi (0.10.2)
Jinja2 (2.9.6)
jsonschema (2.6.0)
jupyter (1.0.0)
jupyter-client (5.0.1)
jupyter-console (5.1.0)
jupyter-core (4.3.0)
lazy-object-proxy (1.2.2)
llvmlite (0.18.0)
locket (0.2.0)
lxml (3.7.3)
MarkupSafe (0.23)
matplotlib (2.0.2)
menuinst (1.4.7)
mistune (0.7.4)
mpmath (0.19)
msgpack-python (0.4.8)
multipledispatch (0.4.9)
navigator-updater (0.1.0)
nbconvert (5.1.1)
nbformat (4.3.0)
networkx (1.11)
nltk (3.2.3)
nose (1.3.7)
notebook (5.0.0)
numba (0.33.0)
numexpr (2.6.2)
numpy (1.12.1)
numpydoc (0.6.0)
odo (0.5.0)
olefile (0.44)
openpyxl (2.4.7)
packaging (16.8)
pandas (0.20.1)
pandocfilters (1.4.1)
partd (0.3.8)
path.py (10.3.1)
pathlib2 (2.2.1)
patsy (0.4.1)
pep8 (1.7.0)
pickleshare (0.7.4)
Pillow (4.1.1)
pip (9.0.1)
ply (3.10)
prompt-toolkit (1.0.14)
psutil (5.2.2)
py (1.4.33)
pycosat (0.6.2)
pycparser (2.17)
pycrypto (2.6.1)
pycurl (7.43.0)
pyflakes (1.5.0)
Pygments (2.2.0)
pylint (1.6.4)
pyodbc (4.0.16)
pyOpenSSL (17.0.0)
pyparsing (2.1.4)
pytest (3.0.7)
python-dateutil (2.6.0)
pytz (2017.2)
PyWavelets (0.5.2)
pywin32 (220)
PyYAML (3.12)
pyzmq (16.0.2)
QtAwesome (0.4.4)
qtconsole (4.3.0)
QtPy (1.2.1)
requests (2.16.0)
rope-py3k (0.9.4.post1)
scikit-image (0.13.0)
scikit-learn (0.18.1)
scipy (0.19.0)
seaborn (0.7.1)
setuptools (27.2.0)
simplegeneric (0.8.1)
singledispatch (3.4.0.3)
six (1.10.0)
snowballstemmer (1.2.1)
sortedcollections (0.5.3)
sortedcontainers (1.5.7)
sphinx (1.5.6)
spyder (3.1.4)
SQLAlchemy (1.1.9)
statsmodels (0.8.0)
sympy (1.0)
tables (3.2.2)
tblib (1.3.2)
testpath (0.3)
toolz (0.8.2)
tornado (4.5.1)
traitlets (4.3.2)
unicodecsv (0.14.1)
urllib3 (1.21.1)
wcwidth (0.1.7)
Werkzeug (0.12.2)
wheel (0.29.0)
widgetsnbextension (2.0.0)
win-unicode-console (0.5)
wrapt (1.10.10)
xlrd (1.0.0)
XlsxWriter (0.9.6)
xlwings (0.10.4)
xlwt (1.2.0)
zict (0.1.2)

(C:\ProgramData\Anaconda3) C:\Users\LNM>

starting python from powershell works fine to so I guess I'll just use powershell/dos box instead of anaconda terminal.

code:
PS C:\Users\LNM> python
Python 3.6.1 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

LochNessMonster fucked around with this message at 20:39 on Jun 4, 2017

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
My first instinct was that conda isn't in your $PATH or whatever the Windows equivalent is, but I just popped open a PowerShell (I don't have conda installed on this computer) and typed 'conda list' and it complained to me about conda not being a recognized command. So unless you trimmed that out of your post then I dunno.

By the way I think PyCharm is the best thing ever as well, coming from vim for approximately 10 years now (gently caress I'm old). I just started using it though and yeah I could definitely see where it might be confusing and intimidating.

LochNessMonster
Feb 3, 2005

I need about three fitty


Well the weird part is that running conda just gives me a blank line. Not an error about command not found or anything. It's just a blank line and back to the prompt.

accipter
Sep 12, 2003

Boris Galerkin posted:

My first instinct was that conda isn't in your $PATH or whatever the Windows equivalent is, but I just popped open a PowerShell (I don't have conda installed on this computer) and typed 'conda list' and it complained to me about conda not being a recognized command. So unless you trimmed that out of your post then I dunno.

By the way I think PyCharm is the best thing ever as well, coming from vim for approximately 10 years now (gently caress I'm old). I just started using it though and yeah I could definitely see where it might be confusing and intimidating.

10 years of vim isn't that impressive. I learned how to exit vim over 17 years ago and I still don't consider myself old. I too use PyCharm for most of my Python development, but also use Vim sometimes for standalone scripts.

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

I don't know anything about their special shell, I have it added to my $PATH (there's like 3 folders) and I just use the normal command line

By the way have they got around to making activate actually work in PowerShell yet? They've been sitting on that issue for years and now it's the default shell in Windows 10 so it would be nice if they could get around to it

Methanar
Sep 26, 2013

by the sex ghost
Just use bash for windows, why worry at all about powershell?

baka kaba
Jul 19, 2003

PLEASE ASK ME, THE SELF-PROFESSED NO #1 PAUL CATTERMOLE FAN IN THE SOMETHING AWFUL S-CLUB 7 MEGATHREAD, TO NAME A SINGLE SONG BY HIS EXCELLENT NU-METAL SIDE PROJECT, SKUA, AND IF I CAN'T PLEASE TELL ME TO
EAT SHIT

Because it's the default shell so it would be nice if it Just Worked

LochNessMonster
Feb 3, 2005

I need about three fitty


Should I worry about conda not doing anything or should I just use pip?

Dominoes
Sep 20, 2007

Like baka said, don't worry about the Anaconda shell.

Conda makes installing binary packages easy, and uniform across WIndows, Mac and Linux. Your alternative is to use installers from this site for packages pip gives you errors with.

It's up to you whether you want to use conda or pip; try them out and make your own choice, or better yet, pick one and don't worry about it yet. I chose to stick with pip only, and ditched Anaconda, because dealing with two separate package managers was confusing; you still have to use pip for packages that aren't on conda.

Hughmoris
Apr 21, 2007
Let's go to the abyss!
Is there a way to scan audio/video file data with Python to pick up on certain sound bits? I'm watching Arrested Development and I'm curious when and how often certain jingles are played, and figured Python might have tools for that.

LochNessMonster
Feb 3, 2005

I need about three fitty


Dominoes posted:

Like baka said, don't worry about the Anaconda shell.

Conda makes installing binary packages easy, and uniform across WIndows, Mac and Linux. Your alternative is to use installers from this site for packages pip gives you errors with.

It's up to you whether you want to use conda or pip; try them out and make your own choice, or better yet, pick one and don't worry about it yet. I chose to stick with pip only, and ditched Anaconda, because dealing with two separate package managers was confusing; you still have to use pip for packages that aren't on conda.

I just tried to do the following in powershell and that doesn't work either.

code:
PS C:\Users\LNM> conda list
PS C:\Users\LNM> conda search
There's no output whatsoever. Pip on the other hand does work.

running the Anaconda command does this:

code:
PS C:\Users\LNM> anaconda
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\Scripts\anaconda-script.py", line 3, in <module>
    import binstar_client.scripts.cli
  File "C:\ProgramData\Anaconda3\lib\site-packages\binstar_client\__init__.py", line 12, in <module>
    from .requests_ext import stream_multipart, NullAuth
  File "C:\ProgramData\Anaconda3\lib\site-packages\binstar_client\requests_ext.py", line 14, in <module>
    from requests.packages.urllib3.filepost import choose_boundary, iter_fields
ModuleNotFoundError: No module named 'requests.packages'

vikingstrike
Sep 23, 2007

whats happening, captain
Didn't you say above you told the installer to not add anything to your PATH? Are you sure that pip working in that instance is not a carry over of a python installation pre-Anaconda?

Dominoes
Sep 20, 2007

I recommend stop trying to run the anaconda shell (I assume that's what typing 'anaconda' in powershell does) until you sort the basics out. It seems like a big stumbling block, and is unnecessary. Viking - if you're right about pip being tied to a prev install, he can test by running 'python' in powershell, and checking if 'Anaconda' appears in the Python console's header.

I think the best option is a clean install. Use the 'Add or Remove Programs' tool in Windows to remove everything with the name Python or Anaconda in it. Run either the Anaconda, or Python installer again, and we'll go from there if you have any issues. Fixing the path is easy (I posted instructions earlier for the non-Anaconda version), but I think it's best you start fresh.

Dominoes fucked around with this message at 13:24 on Jun 5, 2017

vikingstrike
Sep 23, 2007

whats happening, captain
^^ Yep that would definitely be the easiest way to troubleshoot that.

LochNessMonster
Feb 3, 2005

I need about three fitty


Dominoes posted:

I recommend stop trying to run the anaconda shell (I assume that's what typing 'anaconda' in powershell does) until you sort the basics out. It seems like a big stumbling block, and is unnecessary. Viking - if you're right about pip being tied to a prev install, he can test by running 'python' in powershell, and checking if 'Anaconda' appears in the Python console's header.

I think the best option is a clean install. Use the 'Add or Remove Programs' tool in Windows to remove everything with the name Python or Anaconda in it. Run either the Anaconda, or Python installer again, and we'll go from there if you have any issues. Fixing the path is easy (I posted instructions earlier for the non-Anaconda version), but I think it's best you start fresh.

That last post was after a complete uninstall and reinstall of Anaconda. I checked if there were any Python related programs in the Programs/Features list but there weren't.

After this reinstall I selected the option to add the executables to the PATH. When the installer was done the pip command gives results back in powershell but conda commands don't do anything. Id it was a PATH issue I'd expect an error message saying the executable can't be found.

Should I try to uninstall and see if miniconda works?

Edit: The anaconda command was just to see if that did work. Everything I did was in powershell.

edit2: system variable path includes the following directories

code:
C:\ProgramData\Anaconda3
C:\ProgramData\Anaconda3\Library\mingew-w64\bin
C:\ProgramData\Anaconda3\Library\usr\bin
C:\ProgramData\Anaconda3\Library\bin
C:\ProgramData\Anaconda3\Scripts

LochNessMonster fucked around with this message at 16:07 on Jun 5, 2017

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
In Ruby and Elixir, I got in the habit of chaining up operations on collections, with chained Enumerable methods in the former and pipes in the latter:
code:
jobs
|> Stream.map(&identify_most_recent)
|> Stream.reject(&is_nil)
|> Stream.map(&Build.from_job)
|> Stream.filter(fn(build) -> Build.expected_performer(build))
I've got a hang on how the map function and list comprehensions work in isolation, but is there a way to both keep these steps in separate lines for readability but not have to put each step in a separate variable?

Dominoes
Sep 20, 2007

LochNessMonster posted:

That last post was after a complete uninstall and reinstall of Anaconda. I checked if there were any Python related programs in the Programs/Features list but there weren't.

After this reinstall I selected the option to add the executables to the PATH. When the installer was done the pip command gives results back in powershell but conda commands don't do anything. Id it was a PATH issue I'd expect an error message saying the executable can't be found.

Should I try to uninstall and see if miniconda works?

Edit: The anaconda command was just to see if that did work. Everything I did was in powershell.

edit2: system variable path includes the following directories

code:
C:\ProgramData\Anaconda3
C:\ProgramData\Anaconda3\Library\mingew-w64\bin
C:\ProgramData\Anaconda3\Library\usr\bin
C:\ProgramData\Anaconda3\Library\bin
C:\ProgramData\Anaconda3\Scripts

Type 'python' in powershell. What do you see? I'm out of ideas.

FAT32 SHAMER
Aug 16, 2012



Here's an idea: don't try fancy package managers that I don't even fully get when you have pip and plain old Python that work just fine

(Also sit down and learn Pycharm because it's super simple once you get the hang of it)

Eela6
May 25, 2007
Shredded Hen

Cocoa Crispies posted:

In Ruby and Elixir, I got in the habit of chaining up operations on collections, with chained Enumerable methods in the former and pipes in the latter:
code:
jobs
|> Stream.map(&identify_most_recent)
|> Stream.reject(&is_nil)
|> Stream.map(&Build.from_job)
|> Stream.filter(fn(build) -> Build.expected_performer(build))
I've got a hang on how the map function and list comprehensions work in isolation, but is there a way to both keep these steps in separate lines for readability but not have to put each step in a separate variable?

You can chain comprehensions, re-using the same variable name(s) each time. The interpreter will know what you mean. Chaining generator comprehensions in this way is considered idiomatic python, and is fast & efficient!

IN
Python code:

words = "The quick brown fox jumped over the lazy dog".split()
words = (word for word in words if 'o' in word or 'e' in word) # generator comprehension: not evaluated yet!
words = (word[::-1] for word in words) #same here
print(list(words)) #finally evaluated here
OUT
code:
['ehT', 'nworb', 'xof', 'depmuj', 'revo', 'eht', 'god']
You could also use map and filter for this for more traditional functional programming. I prefer comprehensions, especially because you can avoid declaring so many lambdas, but the decision is up to you.

Python code:
words = "The quick brown fox jumped over the lazy dog".split()
words = filter(lambda word: 'o' in word or 'e' in word, words)
words = map(lambda word: word[::-1], words)
print(list(words)) #finally evaluated here

Eela6 fucked around with this message at 06:34 on Jun 6, 2017

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I'm just curious, if you run power she'll in administrative mode (hit the windows key, type powers, right click and choose admin mode) and then type "conda list" does it still show you no output?

Adbot
ADBOT LOVES YOU

shrike82
Jun 11, 2005

Do most of you run Python in Windows?

Package issues like this and the difficulty getting tensorflow running on Windows drove me to a dual boot Ubuntu setup.

It's a pain in the rear end to setup but I've found switching to a Linux build helpful in mitigating stuff like this.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply