ranaroussi / qtpylib

QTPyLib, Pythonic Algorithmic Trading
http://qtpylib.io
Apache License 2.0
2.16k stars 513 forks source link

[BUG] pip install error #141

Open k-bala-vignesh opened 5 years ago

k-bala-vignesh commented 5 years ago

Describe the bug pip install qtpylib gives error

To Reproduce Steps to reproduce the behavior:

  1. Create a virtualenv (python 3.6.5)
  2. pip install qtpylib

Screenshots image

Desktop (please complete the following information):

pasting the ERROR message Collecting qtpylib Using cached https://files.pythonhosted.org/packages/71/86/621ac3870dad934da7b53b23d4a25c2182bab8c538d3971b05b51213f735/QTPyLib-1.5.83.tar.gz ERROR: Command errored out with exit status 1: command: /Users/balavigneshk/Octillery/qtpylib/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/setup.py'"'"'; file='"'"'/private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/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 /private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/pip-egg-info cwd: /private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/ Complete output (1 lines): error in QTPyLib setup command: "values of 'package_data' dict" must be a list of strings (got 'qtpylib/_webapp/*')

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

aabmets commented 5 years ago

I'm having the same problem, can't install QTPyLib.

bsun0802 commented 5 years ago

Hi, having the same problem here.

image

Problem can not solved by this command pip install --ignore-installed --upgrade pip setuptools documented in your documentation.

aabmets commented 5 years ago

If you don't want to wait for fix merge, then open setup.py and replace

package_data={
    'static': 'qtpylib/_webapp/*',
    'db': 'qtpylib/schema.sql*'
 },

with

package_data={
    'static': ['qtpylib/_webapp/*'],
    'db': ['qtpylib/schema.sql*']
 },

then in cmd line run: python setup.py install

(in cmd, activate your venv and cd to where the setup.py is before running the command)

bsun0802 commented 5 years ago

Thanks! Do you mind leaving me your preferred contact app so I can connect with you and discuss about qtpylib.

aabmets commented 5 years ago

Thanks! Do you mind leaving me your preferred contact app so I can connect with you and discuss about qtpylib.

I haven't gotten used to using contact apps, cause I haven't had the need to. I use just e-mail or FB. If you want to mail me then mail to my full name @ gmail.com

ebtrader commented 4 years ago

I am getting that same error

alidanish127 commented 4 years ago

Describe the bug pip install qtpylib gives error

To Reproduce Steps to reproduce the behavior:

  1. Create a virtualenv (python 3.6.5)
  2. pip install qtpylib

Screenshots image

Desktop (please complete the following information):

  • OS: macOS Mojave
  • Version 10.14.5

pasting the ERROR message Collecting qtpylib Using cached https://files.pythonhosted.org/packages/71/86/621ac3870dad934da7b53b23d4a25c2182bab8c538d3971b05b51213f735/QTPyLib-1.5.83.tar.gz ERROR: Command errored out with exit status 1: command: /Users/balavigneshk/Octillery/qtpylib/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/setup.py'"'"'; file='"'"'/private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/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 /private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/pip-egg-info cwd: /private/var/folders/wf/nl5trqzs6ksbcl0dcmgbcdrh0000gn/T/pip-install-1z_py480/qtpylib/ Complete output (1 lines): error in QTPyLib setup command: "values of 'package_data' dict" must be a list of strings (got 'qtpylib/_webapp/*')

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

If you are still facing this issue, it is because QTPyLib has a dependency on Twilio package which isn't stated in the errors. Install Twilio and then installing QTPyLib will happen successfully.

NicholasBallard commented 4 years ago

I'm getting the same error on Windows 10.

Update: Got it working by installing latest Visual Studio Build Tools.

Running Windows 10, install either through Visual Studio Installer (2019 recommended).

image Make sure Windows 10 SDK is checked.

Or via Chocolatey: choco install visualstudio2019buildtools (Doesn't require VS IDE)

Then from an elevated shell, had to uninstall and rebuild cryptography and install Beautiful Soup: pip uninstall cryptography && pip install -U --no-cache-dir cryptography bs4

And that worked! (Test by running sample blotter.py.)

NicholasBallard commented 4 years ago

Ricardo,

I'd check first you have mysql-server installed on Windows

elevated command prompt with Chocolatey installed (get Chocolatey if you don't have it)

choco install mysql --confirm

Then make sure it works by running

mysql -uroot

Shouldn't matter on Windows but I know on *Nix systems sometimes have to be privileged to access mysql (here on Ubuntu):


n@xps13:~$ mysql -u root ERROR 1698 (28000): Access denied for user 'root'@'localhost' n@xps13:~$ sudo mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 11 Server version: 8.0.20-0ubuntu0.20.04.1 (Ubuntu)

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>


On Sat, May 9, 2020 at 2:16 PM Ricardo Cortez notifications@github.com wrote:

I'm getting the following error:

raise errorclass(errno, errval) pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") 2020-05-09 14:11:45,918 [INFO] qtpylib.blotter: Blotter stopped... 2020-05-09 14:11:45,918 [INFO] qtpylib.blotter: Deleting runtime args... 2020-05-09 14:11:45,918 [INFO] qtpylib.blotter: Disconnecting from MySQL...

environment: Windows10 Anaconda Installed MySQL -server from installer and set mysql -u root -p -e "create database qtpy; create user ''@'localhost' identified by ''; grant all privileges on qtpy .* to ''@'localhost';"

with the user and password changes

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ranaroussi/qtpylib/issues/141#issuecomment-626215644, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDAIOAC47YPDCZW7C4ETGDRQWMXZANCNFSM4JIDOLAQ .

pythonian1027 commented 4 years ago

I am using Ubuntu 18.04 and have created a conda environment with Python 3.8, when trying to install from >>python setup.py install I am getting an error, it seems that it is trying to use the /usr/lib/python2.7 as opposed to the version on the environment

creating /usr/local/lib/python2.7/dist-packages/QTPyLib-1.5.84-py2.7.egg Extracting QTPyLib-1.5.84-py2.7.egg to /usr/local/lib/python2.7/dist-packages File "/usr/local/lib/python2.7/dist-packages/QTPyLib-1.5.84-py2.7.egg/qtpylib/blotter.py", line 775 print('*', end="", flush=True) ^ SyntaxError: invalid syntax

File "/usr/local/lib/python2.7/dist-packages/QTPyLib-1.5.84-py2.7.egg/qtpylib/broker.py", line 278 print('*', end="", flush=True) ^ SyntaxError: invalid syntax

QTPyLib 1.5.84 is already the active version in easy-install.pth Installing sample script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/QTPyLib-1.5.84-py2.7.egg Processing dependencies for QTPyLib==1.5.84 Searching for pandas>=0.22.0 Reading https://pypi.python.org/simple/pandas/ Downloading https://files.pythonhosted.org/packages/2f/79/f236ab1cfde94bac03d7b58f3f2ab0b1cc71d6a8bda3b25ce370a9fe4ab1/pandas-1.0.3.tar.gz#sha256=32f42e322fb903d0e189a4c10b75ba70d90958cc4f66a1781ed027f1a1d14586 Best match: pandas 1.0.3 Processing pandas-1.0.3.tar.gz Writing /tmp/easy_install-DDB3B2/pandas-1.0.3/setup.cfg Running pandas-1.0.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-DDB3B2/pandas-1.0.3/egg-dist-tmp-dzNyyt Traceback (most recent call last): File "setup.py", line 64, in 'db': ['qtpylib/schema.sql*'] File "/usr/lib/python2.7/dist-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(**attrs) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/usr/lib/python2.7/dist-packages/setuptools/command/install.py", line 117, in do_egg_install cmd.run() File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 437, in run self.easy_install(spec, not self.no_deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 679, in easy_install return self.install_item(None, spec, tmpdir, deps, True) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 726, in install_item self.process_distribution(spec, dist, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 771, in process_distribution [requirement], self.local_index, self.easy_install File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 774, in resolve replace_conflicting=replace_conflicting File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1057, in best_match return self.obtain(req, installer) File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 1069, in obtain return installer(requirement) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 698, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 724, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 909, in install_eggs return self.build_and_install(setup_script, setup_base) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1177, in build_and_install self.run_setup(setup_script, setup_base, args) File "/usr/lib/python2.7/dist-packages/setuptools/command/easy_install.py", line 1163, in run_setup run_setup(setup_script, args) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 253, in run_setup raise File "/usr/lib/python2.7/contextlib.py", line 35, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python2.7/contextlib.py", line 35, in exit self.gen.throw(type, value, traceback) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 166, in save_modules saved_exc.resume() File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 141, in resume six.reraise(type, exc, self._tb) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/usr/lib/python2.7/dist-packages/setuptools/sandbox.py", line 44, in _execfile code = compile(script, filename, 'exec') File "/tmp/easy_install-DDB3B2/pandas-1.0.3/setup.py", line 42 f"numpy >= {min_numpy_ver}", ^

gendrelom commented 3 years ago

If you don't want to wait for fix merge, then open setup.py and replace

package_data={
    'static': 'qtpylib/_webapp/*',
    'db': 'qtpylib/schema.sql*'
 },

with

package_data={
    'static': ['qtpylib/_webapp/*'],
    'db': ['qtpylib/schema.sql*']
 },

then in cmd line run: python setup.py install

(in cmd, activate your venv and cd to where the setup.py is before running the command)

@aspenforest thanks, and how can I install qtpylib using requirements.txt which Dockerfile calls?

yanivakiva commented 2 years ago

still have this issue, macos catalina

mablue commented 2 years ago

still I have this error :+1: virtualenv archlinux pip installation $ pip install qtpylib --upgrade --no-cache-dir but with cloning git and install with: git clone https://github.com/ranaroussi/qtpylib.git python qtpylib/setup.py install its fixed

miali88 commented 2 years ago

Thanks go0ril. But after I git clone it, and run 'python qtpylib/setup.py install', I get the error [Errno 2] No such file or directory. Seems like the setup.py isn't installing.