python-3.7

While importing auto_arima from pmdarima: ERROR : cannot import name 'factorial' from 'scipy.misc'

我的未来我决定 提交于 2019-12-06 21:33:49
问题 I have python 3.7.1 and scipy version : 1.3.0. I'm getting error while calling auto_arima saying : "cannot import name 'factorial' from 'scipy.misc'" Just this basic import causes the issue:- "from pmdarima.arima import auto_arima" I've tried reinstalling scipy, didn't work 回答1: The function factorial was moved from scipy.misc to scipy.special . The version in scipy.misc has been deprecated for a while, and it was removed in scipy 1.3.0. Something in pmdarima or one of its dependencies is

Error Installing Python.net on Python 3.7

旧巷老猫 提交于 2019-12-06 07:41:33
I am attempting to get Python.net (pythonnet) working on Python 3.7 and when running the setup.py it fails with the following error. I'm assuming that it has to do with a missing entry in the path lines but I coulnd't fine any reference to it. It's basically a pretty plain install of Python 3.7 on Windows 7. the pip install also fails with the same results. Does anyone have a suggestion on what path or file might be missing? PS C:\Users\user\pythonnet-master\pythonnet-master> python setup.py bdist_wheel running bdist_wheel running build running build_ext Checking for updates from https://www

Python 3.7 - asyncio.sleep() and time.sleep()

好久不见. 提交于 2019-12-05 23:11:13
When I go to the asyncio page, the first example is a hello world program. When I run it on python 3.73 , I can't see any different from the normal one, can anyone tell me the difference and give a non-trivial example? In [1]: import asyncio ...: ...: async def main(): ...: print('Hello ...') ...: await asyncio.sleep(5) ...: print('... World!') ...: ...: # Python 3.7+ ...: asyncio.run(main()) Hello ... ... World! In [2]: In [2]: import time ...: ...: def main(): ...: print('Hello ...') ...: time.sleep(5) ...: print('... World!') ...: ...: # Python 3.7+ ...: main() Hello ... ... World! I

How to force VSCode to use Python 3 instead of Python 2?

旧城冷巷雨未停 提交于 2019-12-05 22:07:56
Using macOS. I'm using VSCode 1.28.2 and I am wondering how I can force VSCode to use Python 3 instead of Python 2. Unless I use the shebang: #!/usr/bin/env python3 , I always get an ImportError or some other problem, even though the intrepreter is using Python 3.7. Image here: If I use the shebang, the code works and the output in the Terminal is: <bound method Response.raise_for_status of <Response [200]>> I am using the Python Extension by Microsoft.( https://marketplace.visualstudio.com/items?itemName=ms-python.python ) Any advice would be appreciated. Check issue 2125 which mentions: By

Requests/aiohttp: closing response objects

醉酒当歌 提交于 2019-12-05 17:30:52
I'm a bit confused about the need to .close() a response object in both requests and aiohttp . (Note that this is a separate instance method than session.close() --I'm talking about the response object itself.) Does Response ( requests ) or ClientResponse ( aiohttp ) ever need explicitly call .close() ? If not, what is the purpose of using the response itself as a context manager? ( async with session.request('GET', 'https://www.pastebin.com' ) below.) Why define the two dunder methods for this if it gets closed implicitly as shown below? Some simple tests (below) seem to imply that responses

RuntimeError: asyncio.run() cannot be called from a running event loop

偶尔善良 提交于 2019-12-05 14:32:09
I am trying to learn about asyncio for a websockets client. Every piece of code I try gets the following error: RuntimeError: asyncio.run() cannot be called from a running event loop I have tried the most simple code and it always gives that RuntimeError. I tried installing the full anaconda distribution again, etc, and can´t find what the problem might be. I am using Spyder 3.3.3 with Python 3.7.3 An example of code that should work: import asyncio async def main(): print('hello') await asyncio.sleep(1) print('world') asyncio.run(main()) Error message: File "C:\Users\jmart\Anaconda3\lib\site

Trying to install packages with Python 3.7.2 pip causes TSL/SSL errors

房东的猫 提交于 2019-12-05 05:20:22
I'm running on: Amazon Linux AMI 2018.03.0 Linux ip-xxx-yy-z-ww 4.14.77-70.59.amzn1.x86_64 #1 SMP Mon Nov 12 22:02:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux Multi-python environment. It has both Python 2.7.15 and 3.7.2 installed. Regular (Python2) pip works without a hitch. When I try to run pip3 install flask I get the following errors: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting flask Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to

While importing auto_arima from pmdarima: ERROR : cannot import name 'factorial' from 'scipy.misc'

时光毁灭记忆、已成空白 提交于 2019-12-05 02:16:17
I have python 3.7.1 and scipy version : 1.3.0. I'm getting error while calling auto_arima saying : "cannot import name 'factorial' from 'scipy.misc'" Just this basic import causes the issue:- "from pmdarima.arima import auto_arima" I've tried reinstalling scipy, didn't work The function factorial was moved from scipy.misc to scipy.special . The version in scipy.misc has been deprecated for a while, and it was removed in scipy 1.3.0. Something in pmdarima or one of its dependencies is still using the name scipy.misc.factorial . The culprit appears to be statsmodels 0.9.0. pmdarima depends on

MySQL package for python 3.7

倖福魔咒の 提交于 2019-12-04 23:21:52
问题 I am in the need of saving data into a MySQL database, my problem is I can't find the package... Solution explored: Oracle website: https://dev.mysql.com/downloads/connector/python/ Trying to install MySQLdb from Pycharm it said non existing. So if anyone has an alternative to it for python 3.7, or knows how to get the connector for version 3.7 I would be happy. 回答1: mysqlclient supports python3.7 officially, you can find it here : https://pypi.python.org/pypi/mysqlclient 1)you can download ,

How do I add a timeout to multiprocessing.connection.Client(..) in Python 3.7?

孤者浪人 提交于 2019-12-04 20:37:58
I've got two Python programs running. Program A connects to program B with the multiprocessing module: # Connection code in program A # ----------------------------- import multiprocessing import multiprocessing.connection ... connection = multiprocessing.connection.Client( ('localhost', 19191), # <- address of program B authkey='embeetle'.encode('utf-8') # <- authorization key ) ... connection.send(send_data) recv_data = connection.recv() It works perfectly most of the time. However, sometimes program B is frozen (the details don't matter much, but it usually happens when the GUI from program