Page 15 of 16 First 1113141516 Last
Results 211 to 225 of 240

Thread: Trade Dangerous (Est. 2015) Power user's highly configurable trade optimizer

  1. #211
    Originally Posted by eyeonus View Post (Source)
    No, they have to be set manually. The process for doing so is shown in the two examples in my post: the first one is for windows, the second for the other two.

    By default, it saves '/data/' and '/tmp/' in the cwd, which for TDH2 is wherever TDH2 is installed. For example, my install is located at "G:\Elite Dangerous Programs\Trade Dangerous Helper", so when TDH runs TD, TD creates the folders "G:\Elite Dangerous Programs\Trade Dangerous Helper\data" and "G:\Elite Dangerous Programs\Trade Dangerous Helper\tmp", because the cwd for TDH2 is the TDH2 install location.

    As to how to check, it uses pip, you can Google it. I'm at work now so no time to explain myself right now.
    Thanks. I had figured out the CWD part but I am more concerned about determining if TD has been installed using pip. If it has then TDH2 has to work in a slightly different manner than if it has not, as you correctly point out. I can't use the fact that the data fielder might be in the TDH2 install folder since if you update TD to the latest version by downloading it and overwriting the existing files, that is by not using pip, then the data folder is created in the TDH2 install order in this situation since it is the CWD.

    [EDIT]So, I can use pip show <package name> to find out if it is installed and which version, then I have to query https://pypi.python.org/pypi/{PKG_NAME}/json to get the list of available versions. Onwards and upwards!

  2. #212
    Originally Posted by MarkAusten View Post (Source)
    Thanks. I had figured out the CWD part but I am more concerned about determining if TD has been installed using pip. If it has then TDH2 has to work in a slightly different manner than if it has not, as you correctly point out. I can't use the fact that the data fielder might be in the TDH2 install folder since if you update TD to the latest version by downloading it and overwriting the existing files, that is by not using pip, then the data folder is created in the TDH2 install order in this situation since it is the CWD.

    [EDIT]So, I can use pip show <package name> to find out if it is installed and which version, then I have to query https://pypi.python.org/pypi/{PKG_NAME}/json to get the list of available versions. Onwards and upwards!
    As a hack, if you include just the trade.py file in TDH2, and try a trade command with it, it'll work if the tradedangerous package is installed, and will error if it isn't. That's how I'm currently running it with v2.1.0.4.

    Looks to me like you're on the right path to do it the right way.

  3. #213
    I am having trouble connecting to the server atm. Web services appear to be working, so no reason why the listener shouldn't be working as normal - but it does mean that until I resolve my shell access, I can't apply any updates. Just be aware.

  4. #214
    Originally Posted by Tromador View Post (Source)
    I am having trouble connecting to the server atm. Web services appear to be working, so no reason why the listener shouldn't be working as normal - but it does mean that until I resolve my shell access, I can't apply any updates. Just be aware.
    As long as you updated when I sent you the email, there's no need for concern. The recent spate of updates don't change anything from a purely functional standpoint. The only update to the listener just fixes the importing to work with the new pip-installable TD, and the updates to TD just make it pip-installable.

  5. #215
    Originally Posted by eyeonus View Post (Source)
    As long as you updated when I sent you the email, there's no need for concern. The recent spate of updates don't change anything from a purely functional standpoint. The only update to the listener just fixes the importing to work with the new pip-installable TD, and the updates to TD just make it pip-installable.
    I didn't - because it was an optimisation and not a data change and the server runs like lightning anyway.

    That said, I think I will set up the PIP method on the new virtual host then I can test and switch it over in DNS later - TD can have the honour of being the first live service on the upgraded server.

  6. #216
    Less a question and more a clarification -

    People running on Linux (like me, or rather the server) will likely be running TD as an unprivileged user, but in turn need certain modules installed into the system.

    Now, normally pip will run and resolve any dependencies and install the requested module, but when we want different things in different places, it gets a little more complicated.

    Code:
    Collecting tradedangerous
      Downloading https://files.pythonhosted.org/packages/fe/c0/268e641cfb032f980244f548a3424f324d9224b2a5c9fe31400884ad2a71/tradedangerous-10.0.2-py3-none-any.whl (220kB)
        100% |████████████████████████████████| 225kB 1.8MB/s
    Collecting requests (from tradedangerous)
      Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
        100% |████████████████████████████████| 61kB 4.3MB/s
    Collecting chardet<3.1.0,>=3.0.2 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
        100% |████████████████████████████████| 143kB 2.4MB/s
    Collecting urllib3<1.25,>=1.21.1 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
        100% |████████████████████████████████| 122kB 3.6MB/s
    Collecting idna<2.9,>=2.5 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
        100% |████████████████████████████████| 61kB 4.3MB/s
    Collecting certifi>=2017.4.17 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
        100% |████████████████████████████████| 163kB 2.8MB/s
    Installing collected packages: chardet, urllib3, idna, certifi, requests, tradedangerous
    ...bomb out... fail... etc... error messages galore.


    From this, can I correcfly deduce that TD requires chardet, urllib3, idna, certifi & requests to be installed? I realise many Python releases may have one or more of these by default, however CentOS (even CentOS 7) is a bit strange when it comes to Python 3 and needs a bit of extra help (though nowhere near as much as the CentOS 6 that the server currently runs upon). Don't worry about any other errors I may have got, I'll handle those separately, just need the requested information for now.

  7. #217
    Originally Posted by Tromador View Post (Source)
    Less a question and more a clarification -

    People running on Linux (like me, or rather the server) will likely be running TD as an unprivileged user, but in turn need certain modules installed into the system.

    Now, normally pip will run and resolve any dependencies and install the requested module, but when we want different things in different places, it gets a little more complicated.

    Code:
    Collecting tradedangerous
      Downloading https://files.pythonhosted.org/packages/fe/c0/268e641cfb032f980244f548a3424f324d9224b2a5c9fe31400884ad2a71/tradedangerous-10.0.2-py3-none-any.whl (220kB)
        100% |████████████████████████████████| 225kB 1.8MB/s
    Collecting requests (from tradedangerous)
      Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
        100% |████████████████████████████████| 61kB 4.3MB/s
    Collecting chardet<3.1.0,>=3.0.2 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
        100% |████████████████████████████████| 143kB 2.4MB/s
    Collecting urllib3<1.25,>=1.21.1 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
        100% |████████████████████████████████| 122kB 3.6MB/s
    Collecting idna<2.9,>=2.5 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
        100% |████████████████████████████████| 61kB 4.3MB/s
    Collecting certifi>=2017.4.17 (from requests->tradedangerous)
      Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
        100% |████████████████████████████████| 163kB 2.8MB/s
    Installing collected packages: chardet, urllib3, idna, certifi, requests, tradedangerous
    ...bomb out... fail... etc... error messages galore.


    From this, can I correcfly deduce that TD requires chardet, urllib3, idna, certifi & requests to be installed? I realise many Python releases may have one or more of these by default, however CentOS (even CentOS 7) is a bit strange when it comes to Python 3 and needs a bit of extra help (though nowhere near as much as the CentOS 6 that the server currently runs upon). Don't worry about any other errors I may have got, I'll handle those separately, just need the requested information for now.
    The only thing listed as a requirement in TD's install script is requests. Those others are probably requirements either of requests or of one of requests' requirements, but I can't say for certain. What happens if you install requests, and then install TD?

    EDIT: pytest-runner and pytest are also required for setup and testing, respectively, but I don't think that's an issue in this case.

    Code:
    setup.py:
    ...
            install_requires=["requests"],
            setup_requires=["pytest-runner"],
            tests_require=["pytest"],
    ...

  8. #218
    Originally Posted by eyeonus View Post (Source)
    Those others are probably requirements either of requests
    Ok good. That appears to be the case.

    Code:
    [elite@quoth ~]$ trade
    #/home/elite/.local/bin/trade: TradeDangerous provides a set of trade database facilities for Elite:Dangerous.
    And I can take it from here. Note that my maximum (currently) version of Python is 3.6 so unless the repositories get updated, anything requiring an higher version will cause me issues.

  9. #219
    Installed and set up, but when I try to run just TD (without the listener for now), it vomits up and says it can't find TradeDangerous.sql

    Edit: The templates folder, present on Github, is not present in my pip installed TD distribution (ie, there is no copy at all of Added.csv, RareItem.csv or TradeDangerous.sql). I've tried creating these files in the same place in the heirarchy, but no dice. I'll try copying in TradeDangerous.sql to where it thinks it wants it, but still.


    Code:
    [elite@quoth ~]$ echo $TD_DATA
    /home/elite/tradedangerous/tddata
    [elite@quoth ~]$ echo $TD_TMP
    /home/elite/tradedangerous/tdtmp
    [elite@quoth ~]$ trade import -P eddblink -O clean
    NOTE: Rebuilding cache file: this may take a few moments.
    Traceback (most recent call last):
      File "/home/elite/.local/bin/trade", line 10, in <module>
        sys.exit(main())
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/cli.py", line 70, in main
        trade(argv)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/cli.py", line 126, in trade
        results = cmdenv.run(tdb)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/commands/commandenv.py", line 81, in run
        return self._cmd.run(results, self, tdb)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/commands/import_cmd.py", line 122, in run
        if not plugin.run():
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/plugins/eddblink_plug.py", line 878, in run
        tdb.reloadCache()
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/tradedb.py", line 758, in reloadCache
        cache.buildCache(self, self.tdenv)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/cache.py", line 912, in buildCache
        with sqlPath.open('rU', encoding='utf-8') as sqlFile:
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/pathlib.py", line 1161, in open
        opener=self._opener)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/pathlib.py", line 1015, in _opener
        return self._accessor.open(self, flags, mode)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/pathlib.py", line 387, in wrapped
        return strfunc(str(pathobj), *args)
    FileNotFoundError: [Errno 2] No such file or directory: '/home/elite/tradedangerous/tddata/TradeDangerous.sql'

  10. #220
    Originally Posted by Tromador View Post (Source)
    Installed and set up, but when I try to run just TD (without the listener for now), it vomits up and says it can't find TradeDangerous.sql

    Edit: The templates folder, present on Github, is not present in my pip installed TD distribution (ie, there is no copy at all of Added.csv, RareItem.csv or TradeDangerous.sql). I've tried creating these files in the same place in the heirarchy, but no dice. I'll try copying in TradeDangerous.sql to where it thinks it wants it, but still.


    Code:
    [elite@quoth ~]$ echo $TD_DATA
    /home/elite/tradedangerous/tddata
    [elite@quoth ~]$ echo $TD_TMP
    /home/elite/tradedangerous/tdtmp
    [elite@quoth ~]$ trade import -P eddblink -O clean
    NOTE: Rebuilding cache file: this may take a few moments.
    Traceback (most recent call last):
      File "/home/elite/.local/bin/trade", line 10, in <module>
        sys.exit(main())
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/cli.py", line 70, in main
        trade(argv)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/cli.py", line 126, in trade
        results = cmdenv.run(tdb)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/commands/commandenv.py", line 81, in run
        return self._cmd.run(results, self, tdb)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/commands/import_cmd.py", line 122, in run
        if not plugin.run():
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/plugins/eddblink_plug.py", line 878, in run
        tdb.reloadCache()
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/tradedb.py", line 758, in reloadCache
        cache.buildCache(self, self.tdenv)
      File "/home/elite/.local/lib/python3.6/site-packages/tradedangerous/cache.py", line 912, in buildCache
        with sqlPath.open('rU', encoding='utf-8') as sqlFile:
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/pathlib.py", line 1161, in open
        opener=self._opener)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/pathlib.py", line 1015, in _opener
        return self._accessor.open(self, flags, mode)
      File "/opt/rh/rh-python36/root/usr/lib64/python3.6/pathlib.py", line 387, in wrapped
        return strfunc(str(pathobj), *args)
    FileNotFoundError: [Errno 2] No such file or directory: '/home/elite/tradedangerous/tddata/TradeDangerous.sql'
    It's supposed to be in the data folder. Hmm.. I'll look into this later when I have the time.

  11. #221
    Originally Posted by eyeonus View Post (Source)
    It's supposed to be in the data folder. Hmm.. I'll look into this later when I have the time.
    I can confirm that if I put a copy of TradeDangerous.sql into $TD_DATA then it does try to create the database.

    (I say try, but as it turns out, Centos 7 still has an outdated version of SQLite and so it barfs, but that's my problem, not yours)

  12. #222
    Originally Posted by Tromador View Post (Source)
    I can confirm that if I put a copy of TradeDangerous.sql into $TD_DATA then it does try to create the database.

    (I say try, but as it turns out, Centos 7 still has an outdated version of SQLite and so it barfs, but that's my problem, not yours)
    Okay, changed a thing, built a thing, installed a thing, tested the installed thing, published the thing, installed the published thing, and tested the installed published thing, and the problem is solved, to the limits of my ability to make sure it all works. Apologies. v10.0.3

  13. #223
    Originally Posted by eyeonus View Post (Source)
    v10.0.3
    FYI - pip reports this as 10.1.0

  14. #224
    That's because I've done another release since that point. 10.1.0 is the release immediately following 10.0.3

  15. #225
    Originally Posted by eyeonus View Post (Source)
    That's because I've done another release since that point. 10.1.0 is the release immediately following 10.0.3
    Roger. CentOS is usually a good choice, direct copy from upstream Redhat, all the goodies, will run 'commercial' products who release for RH etc etc (like the Backup Exec agent), but is just backward in a couple of ways. I had hoped going to CentOS 7 would fix it, but they are still using outdated versions of some stuff, so I'm essentially repeating the procedure I had on the current server to build a Python3.7/Sqlite3.27.1 environment from scratch. And it's 0218 and I just fixed another problem which was stopping Python from building right and so I'll finish up tomorrow.

    (Slightly fed up with CentOS at this point, but it's what the guys at my old workplace are willing to support and it's a free and gratis virtual host, so I guess I won't complain too loudly)