tag:help.appveyor.com,2012-11-13:/discussions/questions/32001-ubuntu-python-3-as-defaultAppVeyor: Discussion 2019-02-21T21:00:26Ztag:help.appveyor.com,2012-11-13:Comment/466969582018-12-21T17:29:56Z2018-12-21T17:29:56ZUbuntu Python 3 as default<div><p>Have you tried <code>stack: python 3.4</code> or <code>stack: python 3.5</code> etc. ?</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/466969582018-12-21T18:27:19Z2018-12-21T18:27:19ZUbuntu Python 3 as default<div><p>yes i have tried <code>stack</code> set to python 3.4, 3.5 and 3.6. The system interpreter is still set to python 2.7 as you can see from the <code>build_script</code> phase:</p>
<pre>
<code>python --version
Python 2.7.12
pip --version
pip 18.1 from /usr/local/lib/python2.7/dist-packages/pip-18.1-py2.7.egg/pip (python 2.7)
python -c "import sys, platform, struct; print(sys.platform, platform.machine(), struct.calcsize('P')*8)"
('linux2', 'x86_64', 64)</code>
</pre></div>Iantag:help.appveyor.com,2012-11-13:Comment/466969582018-12-21T18:53:24Z2018-12-21T18:53:24ZUbuntu Python 3 as default<div><p>Sorry, I forgot to mention, <code>stack:</code> should be at top level of yaml. (i.e. the same level as <code>build_script:</code>).</p></div>Owen McDonnelltag:help.appveyor.com,2012-11-13:Comment/466969582018-12-21T19:13:30Z2018-12-21T19:13:30ZUbuntu Python 3 as default<div><p>So if I understand correctly, <code>stack</code> wont allow me to specify the python version in each build? it seems it's a constant used by all builds.</p>
<p>I need to test in both python 2.7 and python 3+ on windows and linux. Windows needs to be tested in both x86 and x64 python versions - this is 6 builds altogether. Im not sure how I would achieve this using <code>stack</code>. Should i be modifying the system path in linux as I have done in the windows builds, or is there an easier way?</p>
<p>Thanks in advance.</p></div>Iantag:help.appveyor.com,2012-11-13:Comment/466969582018-12-21T19:26:02Z2018-12-21T19:26:02ZUbuntu Python 3 as default<div><p>Maybe I have it understood now. I will try this:</p>
<pre>
<code>stack: python 2.7, python 3.6
environment:
GEO_VERSION: '18b'
matrix:
# ... windows here ...
# Ubuntu - python 2.7
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
stack: python 2.7
# Ubuntu - python 3
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
stack: python 3.6</code>
</pre></div>Iantag:help.appveyor.com,2012-11-13:Comment/466969582018-12-21T19:38:53Z2018-12-21T19:38:53ZUbuntu Python 3 as default<div><p>the above will set both Ubuntu builds to python 3. Not able to use python 2.7 as intended in first build.</p></div>Iantag:help.appveyor.com,2012-11-13:Comment/466969582018-12-22T02:03:55Z2018-12-22T02:03:55ZUbuntu Python 3 as default<div><p>You were right. I needed to understand the execution better. I got it to work with this:<br></p>
<pre>
<code>
environment:
GEO_VERSION: '18b'
matrix:
# ... windows here ...
# Ubuntu - python 2.7
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
PYTHON: "2.7"
# Ubuntu - python 3
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
PYTHON: "3.6"
stack: python %PYTHON%</code>
</pre>
<p>Feel free to make this thread pubic if you think it's useful.</p></div>Iantag:help.appveyor.com,2012-11-13:Comment/466969582018-12-22T08:05:07Z2018-12-22T08:05:07ZUbuntu Python 3 as default<div><p>Sorry for not clarifying earlier. Anyway, you figured it out.</p>
<p>Sure, I'll make the thread public so its searchable.</p></div>Owen McDonnell