Pip not working on windows

2020-05-03 Thread Aakash Jana
I recently upgraded pip to version 20.1 and now whenever I try pup install
on my PC I get the following error :- Fatal error in launcher : unable to
create process using '"c:\python38\python.exe '
"c:\Python38\Scripts\pip.exe" : The system cannot find the file specified.
But when I manually inspected the folder 📂 the files were there I even
tried upgrading it by python -m pip install --upgrade pip which worked but
I still can not use pip.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pip not working on windows

2020-05-03 Thread joseph pareti
are you doing *pip** install* from Windows cmd of from Anaconda prompt? I
used the latter and it works

Am So., 3. Mai 2020 um 16:48 Uhr schrieb Aakash Jana <
[email protected]>:

> I recently upgraded pip to version 20.1 and now whenever I try pup install
> on my PC I get the following error :- Fatal error in launcher : unable to
> create process using '"c:\python38\python.exe '
> "c:\Python38\Scripts\pip.exe" : The system cannot find the file specified.
> But when I manually inspected the folder 📂 the files were there I even
> tried upgrading it by python -m pip install --upgrade pip which worked but
> I still can not use pip.
> --
> https://mail.python.org/mailman/listinfo/python-list
>


-- 
Regards,
Joseph Pareti - Artificial Intelligence consultant
Joseph Pareti's AI Consulting Services
https://www.joepareti54-ai.com/
cell +49 1520 1600 209
cell +39 339 797 0644
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Pip not working on windows

2020-05-03 Thread Aakash Jana
Yes, I am!

On Sun, 3 May 2020, 9:39 pm joseph pareti  are you doing *pip** install* from Windows cmd of from Anaconda prompt? I
> used the latter and it works
>
> Am So., 3. Mai 2020 um 16:48 Uhr schrieb Aakash Jana <
> [email protected]>:
>
>> I recently upgraded pip to version 20.1 and now whenever I try pup install
>> on my PC I get the following error :- Fatal error in launcher : unable to
>> create process using '"c:\python38\python.exe '
>> "c:\Python38\Scripts\pip.exe" : The system cannot find the file specified.
>> But when I manually inspected the folder 📂 the files were there I even
>> tried upgrading it by python -m pip install --upgrade pip which worked but
>> I still can not use pip.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
> --
> Regards,
> Joseph Pareti - Artificial Intelligence consultant
> Joseph Pareti's AI Consulting Services
> https://www.joepareti54-ai.com/
> cell +49 1520 1600 209
> cell +39 339 797 0644
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Consumer trait recognition

2020-05-03 Thread julianawaltermann11
Dear Community,

I constructed a lexicon for words that show how different words are linked to 
consumer traits and motivations (e.g. Achievement and Power Motivation).
Now I have collected a large amount of online customer reviews and want to 
match each review with the word definitions of the consumer traits and 
motivations in order to identify whether they influence the consumer 
preferences.

How do I that? Both the lexicons and the customer reviews are csv files.

Thank you in advance!


Best regards,
JW
-- 
https://mail.python.org/mailman/listinfo/python-list


Is there anything in the script which could cause it to not run its full course please?

2020-05-03 Thread ozstar1
Hi,

A nooby here and I could do with some help in finding out what, if anything, is 
wrong with the script

Is there anything in this script that could cause the stream to stop before the 
allocated time? 

For example the time.txt file which gives the times to the script, shows the 
time to start and run, like this..

04-05-2020 09:30:00 40
04-05-2020 12:30:00 40
04-05-2020 15:30:00 40
04-05-2020 22:30:00 40

When I run the the stream manually not using the script, it runs the full 40 
mins length however as soon as I use the script, it stops the stream a few 
minutes in. It is not any specific time, just a random time.

I see my two options are..
something in the script or
something going on in the PC background, although it doesn't do it when I don't 
use the script.

Please help and I am not sure where else to go as it does seem like a script or 
python event.

Thank you



-
import time
import datetime
import sys
from pynput.mouse import Button, Controller
class Autostreaming(object):
 
def __init__(self):
self.mouse = Controller()
pass
 
def startstreaming(self):
#load text file 
time_file = open("time.txt", "r")
for date_time_duration in time_file.readlines():
input_date,input_time,input_duration=date_time_duration.split(' ')
current_datetime = datetime.datetime.now()
current_date = current_datetime.strftime('%d-%m-%Y')
if(input_date>=current_date):
while(True):
_time = datetime.datetime.now()
current_time= _time.strftime('%H:%M:%S')
if(input_time==current_time):
#self.mouse.position = (1912,594)
#self.mouse.click(Button.left,1)
#time.sleep(2)
self.mouse.position = (1250,710)
self.mouse.click(Button.left,1)
time.sleep(2)
self.mouse.position = (1824,1136)
self.mouse.click(Button.left,1)
time.sleep(2)
self.mouse.position = (1587,37)
self.mouse.click(Button.left,1)
time.sleep(2)
self.mouse.position = (1250,710)
self.mouse.click(Button.left,1)
time.sleep(2)
#self.mouse.position = (1202, 806)
#self.mouse.click(Button.left,1)
print("streaming")
time.sleep(int(input_duration)*60)#please put your 
streaming function 
self.mouse.position = (1824,1136)
self.mouse.click(Button.left,1)
break
elif(input_time>current_time):
print('Waiting for the next stream to start at 
{}'.format(input_time)+" hrs on {}".format(input_date))
time.sleep(1)
continue
elif(input_date>current_date and input_timehttps://mail.python.org/mailman/listinfo/python-list


Re: Pip not working on windows

2020-05-03 Thread Mike Dewhirst

On 4/05/2020 12:44 am, Aakash Jana wrote:

I recently upgraded pip to version 20.1 and now whenever I try pup install
on my PC I get the following error :- Fatal error in launcher : unable to
create process using '"c:\python38\python.exe '
"c:\Python38\Scripts\pip.exe" : The system cannot find the file specified.
But when I manually inspected the folder 📂 the files were there I even
tried upgrading it by python -m pip install --upgrade pip which worked but
I still can not use pip.


Just thoughtI'd try it on my Windows PC ...

(xxex3) D:\Users\mike\envs\xxex3>pip install --upgrade -r 
requirements/test.txt

Collecting bleach
  Downloading bleach-3.1.5-py2.py3-none-any.whl (151 kB)
 || 151 kB 2.2 MB/s
Collecting pytz
  Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
 || 510 kB 3.3 MB/s
Collecting requests
  Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Requirement already up-to-date: cirpy in 
d:\users\mike\envs\xxex3\lib\site-packages (from -r 
requirements\../ssds/requirements/base.txt (line 4)) (1.0.2)

Collecting docutils
  Using cached docutils-0.16-py2.py3-none-any.whl (548 kB)
Collecting django==2.2.12
  Using cached Django-2.2.12-py3-none-any.whl (7.5 MB)
Collecting pwned-passwords-django
  Using cached pwned_passwords_django-1.4-py3-none-any.whl (5.8 kB)
Collecting django-csp
  Downloading django_csp-3.6-py2.py3-none-any.whl (17 kB)
Collecting django-referrer-policy
  Downloading django-referrer-policy-1.0.tar.gz (3.6 kB)
Collecting stripe
  Downloading stripe-2.47.0-py2.py3-none-any.whl (203 kB)
 || 203 kB 6.8 MB/s
Collecting coverage
  Downloading coverage-5.1-cp37-cp37m-win_amd64.whl (205 kB)
 || 205 kB 6.4 MB/s
Processing d:\users\mike\downloads\psycopg2-2.7.7-cp37-cp37m-win_amd64.whl
Processing d:\users\mike\downloads\pillow-6.0.0-cp37-cp37m-win_amd64.whl
Collecting django-debug-toolbar
  Using cached django_debug_toolbar-2.2-py3-none-any.whl (198 kB)
Collecting packaging
  Downloading packaging-20.3-py2.py3-none-any.whl (37 kB)
Requirement already satisfied, skipping upgrade: webencodings in 
d:\users\mike\envs\xxex3\lib\site-packages (from bleach->-r 
requirements\../ssds/requirements/base.txt (line 1)) (0.5.1)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in 
d:\users\mike\envs\xxex3\lib\site-packages (from bleach->-r 
requirements\../ssds/requirements/base.txt (line 1)) (1.12.0)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (2019.3.9)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (3.0.4)
Requirement already satisfied, skipping upgrade: 
urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (1.24.2)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (2.8)
Requirement already satisfied, skipping upgrade: sqlparse in 
d:\users\mike\envs\xxex3\lib\site-packages (from django==2.2.12->-r 
requirements\../ssds/requirements/base.txt (line 6)) (0.3.0)

Collecting pyparsing>=2.0.2
  Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
 || 67 kB 4.5 MB/s
Installing collected packages: pyparsing, packaging, bleach, pytz, 
requests, docutils, django, pwned-passwords-django, django-csp, 
django-referrer-policy, stripe, coverage, psycopg2, Pillow, 
django-debug-toolbar

  Attempting uninstall: bleach
    Found existing installation: bleach 3.1.0
    Uninstalling bleach-3.1.0:
  Successfully uninstalled bleach-3.1.0
  Attempting uninstall: pytz
    Found existing installation: pytz 2019.1
    Uninstalling pytz-2019.1:
  Successfully uninstalled pytz-2019.1
  Attempting uninstall: requests
    Found existing installation: requests 2.21.0
    Uninstalling requests-2.21.0:
  Successfully uninstalled requests-2.21.0
  Attempting uninstall: docutils
    Found existing installation: docutils 0.14
    Uninstalling docutils-0.14:
  Successfully uninstalled docutils-0.14
  Attempting uninstall: django
    Found existing installation: Django 2.2.10
    Uninstalling Django-2.2.10:
  Successfully uninstalled Django-2.2.10
  Attempting uninstall: pwned-passwords-django
    Found existing installation: pwned-passwords-django 1.3.1
    Uninstalling pwned-passwords-django-1.3.1:
  Successfully uninstalled pwned-passwords-django-1.3.1
    Running setup.py install for django-referrer-policy ... done
  Attempting uninstall: stripe
    Found existing installation: stripe 2.29.0

=+ for strings

2020-05-03 Thread James Smith
I tried:
dt=+"{:02d}".format(day)
but I got:
dt=+"{:02d}".format(day)
TypeError: bad operand type for unary +: 'str'

This works:
dt=dt+"{:02d}".format(day)

Why can't I do the shortcut on strings?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: =+ for strings

2020-05-03 Thread Chris Angelico
On Mon, May 4, 2020 at 12:41 PM James Smith  wrote:
>
> I tried:
> dt=+"{:02d}".format(day)
> but I got:
> dt=+"{:02d}".format(day)
> TypeError: bad operand type for unary +: 'str'
>
> This works:
> dt=dt+"{:02d}".format(day)
>
> Why can't I do the shortcut on strings?

The shortcut is += not =+ :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: =+ for strings

2020-05-03 Thread Dan Sommers
On Sun, 3 May 2020 19:38:06 -0700 (PDT)
James Smith  wrote:

> I tried:
> dt=+"{:02d}".format(day)
> but I got:
> dt=+"{:02d}".format(day)
> TypeError: bad operand type for unary +: 'str'
> 
> This works:
> dt=dt+"{:02d}".format(day)
> 
> Why can't I do the shortcut on strings?

ITYM:

dt += "{:02d}".format(day)

Note += rather than =+ (which is parsed as an assignment operator
followed by a unary plus operator).

-- 
“Atoms are not things.” – Werner Heisenberg
Dan Sommers, http://www.tombstonezero.net/dan
-- 
https://mail.python.org/mailman/listinfo/python-list


Import machinery for extracting non-modules from modules (not using import-from)

2020-05-03 Thread Adam Preble
The (rightful) obsession with modules in PEP-451 and the import machinery hit 
me with a gotcha when I was trying to implement importing .NET stuff that 
mimicked IronPython and Python.NET in my interpreter project.

The meat of the question:
Is it important that the spec loader actually return a module? Can it just 
return... stuff? I know a from X import Y is the normal means for this, but if 
the loader knows better, can it just do it?

A normal process is something like:
import X

A bunch of finders line up to see if they know anything about X. If they don't, 
they return None. Assume it's found. That finder will return a module spec for 
how to load it.

A little later, that spec is instructed to load the module.

If X wasn't a module, you can expect to see something like:
ModuleNotFoundError: No module named 'X'; 'X' is not a package

...you were supposed to do 'from something import X'. I'm actually trying to 
figure out if there's a way with normal Python modules where I can even be in a 
situation to just blandly trying to import X without a package in front of it.

With IronPython--and I'm pretty sure Python.NET, there are situations where you 
CAN do this. The paths for .NET 'packages' are the .NET namespaces (a slightly 
different usage of the term). Say I want the machine name. It would be typical 
to get that with System.Environment.MachineName. MachineName is a static field 
in Environment. System.Environment is a namespace in mscorlib (in classic .NET 
framework).

The .NET namespace can be null. In that case it's just in the root namespace or 
something. Let's say I have a .dll I've made known to IronPython or Python.NET 
using its clr.AddReference, and I want to toy with some class defined without a 
namespace called "Crazy." This is totally fine:
import Crazy

I really can't follow what either one is doing here, and I don't know how well 
they're even latching on the PEP-451. So there's the main question: is it 
important that the spec loader actually return a module? Can it just return... 
stuff? I know a from X import Y is the normal means for this, but if the loader 
knows better, can it just do it?
-- 
https://mail.python.org/mailman/listinfo/python-list