Unable to use pip to install packages
Hi Team, Thanks for your support. I am having trouble installing any packages using pip in Python 3.x (earlier had Python 3.8.3, so changed to 3.8.8) in Windows 10. Please help me with below issues: ---C:\Users\mohsohai>pip install pytestTraceback (most recent call last): File "C:\Users\mohsohai\AppData\Local\Programs\Python\Python38\Scripts\pip-script.py", line 11, in load_entry_point('pip==21.0.1', 'console_scripts', 'pip')() File "c:\users\mohsohai\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\cli\main.py", line 71, in main command = create_command(cmd_name, isolated=("--isolated" in cmd_args)) File "c:\users\mohsohai\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\__init__.py", line 96, in create_command module = importlib.import_module(module_path) File "c:\users\mohsohai\appdata\local\programs\python\python38\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "c:\users\mohsohai\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\install.py", line 12, in from pip._internal.cache import WheelCacheModuleNotFoundError: No module named 'pip._internal.cache'- Note: Have included pip in Enviromnet Variables Thank you,Sohail. -- https://mail.python.org/mailman/listinfo/python-list
[issue23882] unittest discovery doesn't detect namespace packages when given no parameters
Md Jony Hossain Habib added the comment: diff -r 293d9964cf6e Lib/unittest/loader.py --- a/Lib/unittest/loader.pyTue Apr 28 00:04:53 2015 -0400 +++ b/Lib/unittest/loader.pyTue Apr 28 10:12:07 2015 +0300 @@ -338,7 +338,7 @@ raise ImportError('Start directory is not importable: %r' % start_dir) if not is_namespace: -tests = list(self._find_tests(start_dir, pattern)) +tests = list(self._find_tests(start_dir, pattern, namespace=True)) return self.suiteClass(tests) def _get_directory_containing_module(self, module_name): @@ -403,7 +403,7 @@ name = self._get_name_from_path(full_path) self._loading_packages.add(name) try: -yield from self._find_tests(full_path, pattern, namespace) +yield from self._find_tests(full_path, pattern, False) finally: self._loading_packages.discard(name) diff -r 293d9964cf6e Lib/unittest/test/test_program.py --- a/Lib/unittest/test/test_program.py Tue Apr 28 00:04:53 2015 -0400 +++ b/Lib/unittest/test/test_program.py Tue Apr 28 10:12:07 2015 +0300 @@ -16,7 +16,7 @@ expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) self.wasRun = False -def _find_tests(start_dir, pattern): +def _find_tests(start_dir, pattern, namespace): self.wasRun = True self.assertEqual(start_dir, expectedPath) return tests -- nosy: +mdjonyhossainhabib ___ Python tracker <https://bugs.python.org/issue23882> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42441] UnicodeEncodeError
New submission from Md Tausif Iqbal : my application crashes File "c:\users\tausif\appdata\local\programs\python\python38-32\lib\csv.py", line 154, in writerow return self.writer.writerow(self._dict_to_list(rowdict)) File "c:\users\tausif\appdata\local\programs\python\python38-32\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode characters in position 22-29: character maps to I know this error is occurring due to a Hindi Language character. -- components: Library (Lib) messages: 381650 nosy: mdtausifiqbal priority: normal severity: normal status: open title: UnicodeEncodeError type: crash versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue42441> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39731] ModuleNotFoundError: No module named '_ctypes'
New submission from Md. Al-Helal : ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-68ypuk30/django-tables2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-68ypuk30/django-tables2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-68ypuk30/django-tables2/pip-egg-info cwd: /tmp/pip-install-68ypuk30/django-tables2/ Complete output (11 lines): Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in from setuptools.dist import Distribution, Feature File "/usr/local/lib/python3.8/site-packages/setuptools/dist.py", line 35, in from setuptools import windows_support File "/usr/local/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in import ctypes File "/usr/local/lib/python3.8/ctypes/__init__.py", line 7, in from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. -- components: ctypes messages: 362511 nosy: alhelal priority: normal severity: normal status: open title: ModuleNotFoundError: No module named '_ctypes' type: compile error versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue39731> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: "Edit with IDLE" doesn't work any more ?
On Friday, April 28, 2017 at 5:37:55 PM UTC+5:30, Yip, Kin wrote: > Hi, > > I'm relatively new with Python3 in Windows 7. I'm using now Python 3.6.1. > > Suddenly right-clicking on a .py file and choose "Edit with IDLE" just > doesn't work. > > I've tried to do : > > "c:\program files\python36\pythonw.exe" -m idlelibmypythoncodes.py > > > the IDLE editor just doesn't come up.But if I start the IDLE Shell and > then "Open File", the editor is there and > works normally. > > I've tried to uninstall "python launcher" and then repair or modify > "python3.6 " in Control Panel/Program and Features. Nothing works ... > > Any help ? I show you my Windows registry at the bottom of this email. > > Kin > > PS: My registry : > > Windows Registry Editor Version 5.00 > > [HKEY_CLASSES_ROOT\Python.File\shell] > > [HKEY_CLASSES_ROOT\Python.File\shell\editwithidle] > "MUIVerb"=" with IDLE" > "Subcommands"="" > > [HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell] > > [HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit36] > "MUIVerb"="Edit with IDLE 3.6 (64-bit)" > > [HKEY_CLASSES_ROOT\Python.File\shell\editwithidle\shell\edit36\command] > @="\"C:\\Program Files\\Python36\\pythonw.exe\" -m idlelib \"%L\" %*" > > [HKEY_CLASSES_ROOT\Python.File\shell\open] > > [HKEY_CLASSES_ROOT\Python.File\shell\open\command] > @="\"C:\\WINDOWS\\py.exe\" \"%L\" %*" > > [HKEY_CLASSES_ROOT\Python.File\shell\Run] > > [HKEY_CLASSES_ROOT\Python.File\shell\Run\command] > @="\"C:\\Windows\\py.exe\" \"%1\" %*" > > [HKEY_CLASSES_ROOT\Python.File\shell\runas] > > [HKEY_CLASSES_ROOT\Python.File\shell\runas\command] > @="\"C:\\Windows\\py.exe\" \"%1\" %*" Hello Brother I got the promblem. I got too frustrated. But now i have solution for it. Just download "api-ms-win-crt-utility-l1-1-0.dll". For this worked. And if this doesnt work download these dll too:- api-ms-win-crt-conio-l1-1-0.dll api-ms-win-crt-convert-l1-1-0.dll api-ms-win-crt-environment-l1-1-0.dll api-ms-win-crt-filesystem-l1-1-0.dll api-ms-win-crt-heap-l1-1-0.dll api-ms-win-crt-locale-l1-1-0.dll api-ms-win-crt-math-l1-1-0.dll api-ms-win-crt-process-l1-1-0.dll api-ms-win-crt-runtime-l1-1-0.dll api-ms-win-crt-stdio-l1-1-0.dll api-ms-win-crt-string-l1-1-0.dll api-ms-win-crt-time-l1-1-0.dll This is it. If the problem continues, then i don't know what to do. I this will Help. -- https://mail.python.org/mailman/listinfo/python-list
Fwd: how to collect old tweets from 03-20 Aug, 2014 for a particular location
Hello, I am a PhD student. I am new to python and using TwitterSearch to collect tweets from 03-20 Aug for a particular location (geocode). I am trying to run the following piece of code. twitter = Twython(CONSUMER_KEY,CONSUMER_SECRET,ACCESS_KEY,ACCESS_SECRET) results = twitter.cursor(twitter.search, q='', max_id='501488707195924481', count=100, geocode='38.00,-91.00') for result in results: print (result['id_str']) However, it is not returning anything. Please help me in this regard. Can I collect old tweets without any keyword for a particular location? Thanks in advance. Regards, Mohammed -- https://mail.python.org/mailman/listinfo/python-list
How to extract contents of inner text of html tag?
Hi, ###in.txt kbd class=command cp -v --remove-destination /usr/share/zoneinfo/ em class=replaceablecodexxx/code/em \ /etc/localtime /kbd import sys import unicodedata from bs4 import BeautifulSoup file_name=in.txt html_doc=open(file_name,'r') soup=BeautifulSoup(html_doc) #print soup.prettify().encode('utf-8') #file_to_write.writelines( soup.prettify().encode() ) all_kbd=soup.find_all('kbd') for line in all_kbd: if line.string == None: extract_code=line.code.extract().string #store_code=line.code.decompose() for inside_line in line: if not in inside_line and EOF not in inside_line: if len(inside_line)0: print inside_line print extract_code expected output: cp -v --remove-destination /usr/share/zoneinfo/xxx\ /etc/localtime Got output: cp -v --remove-destination /usr/share/zoneinfo/ None \ /etc/localtime None shibly -- https://mail.python.org/mailman/listinfo/python-list
Re: PEP8 79 char max
In my experience, aligning columns in large tables reduces maintence cost by making it much easier/faster to see what you've got and by providing a way to visually prompt you for the correct value in the correct place when you add new lines. Works great until one of the values changes in size. Say: bla = ( 1.0, 1.1, 1.2, 2.0, 2.1, 2.2, 3.0, 2.1, 3.2, ) And one day you have to change '2.1' to '2.0': bla = ( 1.0, 1.1, 1.2, 2.0, 2.0, 2.2, 3.0, 2.1, 3.2, ) If this happens more than once ( or twice, because I'm patient =)), maintaining the alignment becomes a chore. So I only align columns if I'm typing a table I know won't change. -- Marcelo Mallmann Dias -- http://mail.python.org/mailman/listinfo/python-list
Setting value of Python variable in a Python C extension
Hi, I have a function developed in C that is being used as a Python extension. The function is being passed a variable from the Python program. Is it possible to change the value of this variable from within the C function? Thanks, -MD -- http://mail.python.org/mailman/listinfo/python-list
Re: Setting value of Python variable in a Python C extension
Hi Carsten, Thanks for your reply. I am a newbie on Python so your help is much appreciated. My program structure is basically like this . (rough representation) test.py var1 = rc = func1 (var1) test.c func1(*v1) { strcpy(v1, Hello World); } So basically I want to modify value of var1 in the function func1 defined in test.c. Is this possible? Thanks, -Manas On Oct 1, 11:26 am, Carsten Haese [EMAIL PROTECTED] wrote: On Mon, 2007-10-01 at 09:08 -0700, MD wrote: Hi, I have a function developed in C that is being used as a Python extension. The function is being passed a variable from the Python program. Is it possible to change the value of this variable from within the C function? That question is ill-defined because Python doesn't have variables. Python has objects and names. Change the value of this variable can either mean that you want to mutate an object that's passed by the caller, which you can do as long as the object is mutable, or you want to rebind a name in the caller's namespace, which you can't do. Why do you think your function needs to have side-effects instead of simply returning a return value? -- Carsten Haesehttp://informixdb.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list
How to change a PyObject passed to the C extension
Hi, I have a Python C extension which is passed a PyObject containing an integer value. Is it possible to change this same PyObject so that now the integer is of a different value? Thanks and Regards, -MD -- http://mail.python.org/mailman/listinfo/python-list
Re: Does PyModule_GetDict return information about class method variables?
Hi Marc, Thanks for your reply. I am calling my extension function from the class method itself. So at that point the variable does exist. I am puzzled why PyModule_GetDict is not able to access the variable even though it does exist at that point. Thanks, -Manas On Aug 10, 12:43 am, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Thu, 09 Aug 2007 19:34:37 -0700, MD wrote: I have a variable which is defined inside a class method. When I call PyModule_GetDict on the module containing this class, the dictionary doesn't contain any information about this variable. Is this expected behavior? If so, what options do I have to access this variable from my Python C extension. You can't access names in methods because they don't exist until you call the method. It's just like local variables in C. Consider: void foo(void) { int bar = 42; } Here `bar` does not exist until you call `foo()` and it disappears as soon as the function returns. It's the very same situation in Python: class A(object): def foo(self): bar = 42 The local name `bar` only exists if `foo()` is called on an instance of `A`. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list
Does PyModule_GetDict return information about class method variables?
Hi, I have a variable which is defined inside a class method. When I call PyModule_GetDict on the module containing this class, the dictionary doesn't contain any information about this variable. Is this expected behavior? If so, what options do I have to access this variable from my Python C extension. Thanks and Regards, -MD -- http://mail.python.org/mailman/listinfo/python-list
Re: Accessing Python variables in an extension module
Hi Alex, Thanks for your reply. It was exactly what I was looking for. Two additional questions 1) Is there anyway to find out which modules a variable belongs to when I have only its name (and its not qualified with the complete name like module.varname) 2) Is there anyway to find the type of the object in C using something like a switch statement? I was looking for something like this switch type(object) { STRING: This is a string object; break; INTEGER: This is an integer object; break; BOOLEAN: This is a boolean object; . . } I don't want to run all the C Py***_Check functions on the object. Something like the switch statement above will lead to nice and clean code. Thanks again for your reply. Regards, -Manas On Jul 15, 11:02 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: MD [EMAIL PROTECTED] wrote: Hi, I would like to access variables defined in my Python program in a C module extension for Python. Is this possible? I looked at the Python C API reference but didn't find anything there that could help me. If they're global variables of a certain module XYZ, your C code may import XZY (or look it up in the C API equivalent of the sys.modules dict) and get those variables as attributes of object XYZ. Is that what you mean by ``variables defined in your Python program''...? Alex -- http://mail.python.org/mailman/listinfo/python-list
Re: Accessing Python variables in an extension module
Hi Alex, Thanks for the answer. Are there any C defines (for e.g. STRING, BOOLEAN) corresponding to each Python type? Thanks, -Manas On Jul 16, 9:53 am, [EMAIL PROTECTED] (Alex Martelli) wrote: MD [EMAIL PROTECTED] wrote: Hi Alex, Thanks for your reply. It was exactly what I was looking for. Two additional questions 1) Is there anyway to find out which modules a variable belongs to when I have only its name (and its not qualified with the complete name like module.varname) Loop through all modules in sys.modules and you will find a set (which may be empty) of modules which happen to have that name as an attribute. It's a very peculiar thing to do (not clear what you expect to do based on that information) but not difficult. 2) Is there anyway to find the type of the object in C using something like a switch statement? I was looking for something like this switch type(object) { STRING: This is a string object; break; INTEGER: This is an integer object; break; BOOLEAN: This is a boolean object; . . } I don't want to run all the C Py***_Check functions on the object. Something like the switch statement above will lead to nice and clean code. Each Python object, in C, carries a pointer to its type object. Of course there are unbounded numbers of types, but at least you can get such information as the type's name and the module if any in which it may have been defined, essentially like you'd do with type(somobj) if you were working directly in Python. Alex -- http://mail.python.org/mailman/listinfo/python-list
Accessing Python variables in an extension module
Hi, I would like to access variables defined in my Python program in a C module extension for Python. Is this possible? I looked at the Python C API reference but didn't find anything there that could help me. Thanks in advance for any help/tips. Regards, -MD -- http://mail.python.org/mailman/listinfo/python-list
Tests for Python Database API
Hi, Are there any tests that will help me ensure that my Python database driver conforms to the Database API v2.0 specification? Thanks in advance. Regards, -MD -- http://mail.python.org/mailman/listinfo/python-list
HL7 servers in Python?
Richard, I was most impressed by your answer below (in '03) Do you know whether there is a third party application/library that can interface our software to the HL7 sockets systems so we do not have to develop them? If you do, which one would you recommend? Thank you, [] Richard M. Low MD CEO Infor-Med Corporation 6271 Variel Avenue, Suite A Woodland Hills, California 91367-2512, USA Phone: 818-592-2900 Direct fax: (818)743-7759 Email: mailto:[EMAIL PROTECTED][EMAIL PROTECTED] URL: http://www.infor-med.com/http://www.infor-med.com HL7 servers in Python? Richard Sharp mailto:python-list%40python.org?Subject=HL7%20servers%20in%20Python%3FIn-Reply-To=rbsharp at gmx.de Mon Jun 16 17:29:22 CEST 2003 * Previous message: http://mail.python.org/pipermail/python-list/2003-June/210414.htmlStructure and Interpretation of Computer Programs in Python? * Next message: http://mail.python.org/pipermail/python-list/2003-June/210188.htmlHL7 servers in Python? * Messages sorted by: http://mail.python.org/pipermail/python-list/2003-June/date.html#210163[ date ] http://mail.python.org/pipermail/python-list/2003-June/thread.html#210163[ thread ] http://mail.python.org/pipermail/python-list/2003-June/subject.html#210163[ subject ] http://mail.python.org/pipermail/python-list/2003-June/author.html#210163[ author ] -- On Fri, 13 Jun 2003 07:10:26 +1000, Tim Churches wrote: Does anyone know of a Python HL7 socket server/daemon - that is, a daemon which accepts socket connections on a TCP port from an HL7 source, receives an HL7 message via the connection, hands off the message for processing, and then sends back an ACK or NACK H7 message - usually synchronously, via a blocking connection (thus the server needs to be multi-threaded)? HL7 stands for Health Level 7 (where 7 represents the 7th layer of the OSI network stack) and is a widely-used standard for communication of medical information. I'm not looking for HL7 message assembly or parsing libraries, just the socket server bit. Perhaps the SocketServer module in the Python library makes this so trivial that no-one has felt the need to write a specific HL7 server in Python? Anyway, I've looked on Google but can't spot anything obvious. It is extremely doubtful, given the specialised nature of the question, whether most people understand what you want. Given that HL7 is really only sending and receiving some information in a curious format, and that you either receive data and then send the other side an ACK or a NAK, or wait until they do that in reply to your message, it is really not all that complicated. The short answer to you question ist Twisted - http://www.twistedmatrix.comhttp://www.twistedmatrix.com What may confuse you is that it does not use blocking sockets and therefore does not need to be multithreaded, although I think it can be, but it does work. My bread and butter Python work is software that interfaces between a Pathology System running any number of versions of Unix and some overarching Hospital System that provides me with patient data and to which I deliver reports and accounting data, mostly, but not always, in HL7. I have one Pathology Unit that does work for two hospitals and communicates with two hospital systems. With Twisted I basically subclass protocol.Factory and implement the necessary submethods. It is a little daunting at first and there was at the time (about 2 years ago) when no usable documentation worth speaking of was available. I am also stuck at the moment with Twisted 0.18.0, because it runs with Python 1.5.2, and I had trouble getting Python = 2.0 running on the all the Unixes I had to get it running on. In the meantime, I think I've got that under control. If you're interested in looking at the programms I will have to ask the company I developed the software for, but the complete program is only ca. 800 Lines and covers 4 Low Level Protocols. I hope I have been of some help. Once people realise that what you want is some sort of select-loop-server, then they will probably gush forth with helpful suggestions. Greetings, Richard Sharp -- * Previous message: http://mail.python.org/pipermail/python-list/2003-June/210414.htmlStructure and Interpretation of Computer Programs in Python? * Next message: http://mail.python.org/pipermail/python-list/2003-June/210188.htmlHL7 servers in Python? * Messages sorted by: http://mail.python.org/pipermail/python-list/2003-June/date.html#210163[ date ] http://mail.python.org/pipermail/python-list/2003-June/thread.html#210163[ thread ] http://mail.python.org/pipermail/python-list/2003-June/subject.html#210163[ subject ] http://mail.python.org/pipermail/python-list/2003-June/author.html#210163[ author ] -- http://mail.python.org/mailman/listinfo/python-listMore information about the Python-list mailing list attachment: clip_image002.jpg
Need Help in Python source code
Hi, I am in need of Python source codes that deals with both multithreading andsocket programming(server-client). I need an example of a client/server multi-threading simulatorfor the clientsto generate a high level of threading to "stress" the server side concurrently.In the end,it can benchmark the server's performance to assessthe results.Please advise any good, relatedsites orcomplete, relevant source codes regardingmysimulator here. Your appreciation is greatly appreaciated.Regards,Khai R.Find just what you are after with the more precise, more powerful new MSN Search Try it now. -- http://mail.python.org/mailman/listinfo/python-list