{"componentChunkName":"component---src-templates-work-js","path":"/works/installing-tensorflow-on-m1-with-pyenv","result":{"data":{"datoCmsWork":{"seoMetaTags":{"tags":[{"tagName":"title","content":"Installing tensorflow on M1 with pyenv"},{"tagName":"meta","attributes":{"property":"og:title","content":"Installing tensorflow on M1 with pyenv"}},{"tagName":"meta","attributes":{"name":"twitter:title","content":"Installing tensorflow on M1 with pyenv"}},{"tagName":"meta","attributes":{"name":"description","content":"Pitch founders hackathon business-to-business growth hacking pivot rockstar deployment business model canvas handshake stock business-to-consumer. "}},{"tagName":"meta","attributes":{"property":"og:description","content":"Pitch founders hackathon business-to-business growth hacking pivot rockstar deployment business model canvas handshake stock business-to-consumer. "}},{"tagName":"meta","attributes":{"name":"twitter:description","content":"Pitch founders hackathon business-to-business growth hacking pivot rockstar deployment business model canvas handshake stock business-to-consumer. "}},{"tagName":"meta","attributes":{"name":"twitter:site","content":"@xxx"}},{"tagName":"meta","attributes":{"name":"twitter:card","content":"summary"}},{"tagName":"meta","attributes":{"property":"article:modified_time","content":"2022-06-24T15:13:02Z"}},{"tagName":"meta","attributes":{"property":"article:published_time","content":"2022-03-16T09:35:12Z"}},{"tagName":"meta","attributes":{"property":"article:publisher","content":"https://www.facebook.com/xxx"}},{"tagName":"meta","attributes":{"property":"og:locale","content":"en_EN"}},{"tagName":"meta","attributes":{"property":"og:type","content":"article"}},{"tagName":"meta","attributes":{"property":"og:site_name","content":"Fred Lich"}},{"tagName":"meta","attributes":{"property":"og:image","content":"https://www.datocms-assets.com/28985/1590861119-favicon.png?w=1000&fit=max&fm=jpg"}},{"tagName":"meta","attributes":{"name":"twitter:image","content":"https://www.datocms-assets.com/28985/1590861119-favicon.png?w=1000&fit=max&fm=jpg"}}]},"title":"Installing tensorflow on M1 with pyenv","excerpt":"Tensorflow is tricky to install on an M1 mac. Here's how I got it working","gallery":[],"descriptionNode":{"childMarkdownRemark":{"html":"<h2>Install Miniforge with pyenv</h2>\n<p><code>pyenv install --list</code> to get latest version of miniforge. Mine was:</p>\n<p><code>pyenv install miniforge3-4.10.3-10</code></p>\n<h2>Activate miniforge env</h2>\n<p><code>pyenv activate miniforge3-4.10.3-10</code></p>\n<p><strong><em>EDIT 23/06/22 — Apparently pyenv no longer uses <code>pyenv activate</code> so instead use <code>pyenv shell miniforge3-4.10.3-10</code> – Thanks David Lasry. You could also use set the miniforge version to your local directory using <code>pyenv local [version]</code></em></strong></p>\n<h2>Create a conda env</h2>\n<p><code>conda create --name env_tensorflow python=3.9</code></p>\n<p>Activate env:\n<code>conda activate env_tensorflow</code></p>\n<p>You are now in a conda env in a pyenv env. Envception.</p>\n<h2>Install tensorflow dependencies</h2>\n<p><code>conda install -c apple tensorflow-deps</code></p>\n<h2>Install tensorflow-macos</h2>\n<p>You'll have to use pip for this.</p>\n<p><code>pip install tensorflow-macos</code></p>\n<p>ignore any errors.</p>\n<h2>To use GPU install tensorflow-metal</h2>\n<p><code>pip install tensorflow-metal</code></p>\n<h2>Try and import tensorflow in the python shell</h2>\n<p><code>python</code>\n<code>>>> import tensorflow as tf</code></p>\n<p>If it works it works!</p>"}},"coverImage":{"url":"https://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png","fluid":{"base64":"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QBMRXhpZgAASUkqAAgAAAABAGmHBAABAAAAGgAAAAAAAAADAAGgAwABAAAA//8AAAKgBAABAAAAFAAAAAOgBAABAAAAAQAAAAAAAAD/2wEEEAAJAAsACwANABEADQASABQAFAASABgAGgAYABoAGAAkACEAHgAeACEAJAA2ACcAKQAnACkAJwA2AFEAMwA7ADMAMwA7ADMAUQBHAFYARwBCAEcAVgBHAIAAZQBZAFkAZQCAAJQAfAB2AHwAlACzAKAAoACzAOEA1QDhASUBJQGKEQAJAAsACwANABEADQASABQAFAASABgAGgAYABoAGAAkACEAHgAeACEAJAA2ACcAKQAnACkAJwA2AFEAMwA7ADMAMwA7ADMAUQBHAFYARwBCAEcAVgBHAIAAZQBZAFkAZQCAAJQAfAB2AHwAlACzAKAAoACzAOEA1QDhASUBJQGK/8IAEQgAAQAUAwEiAAIRAQMRAf/EACgAAQEAAAAAAAAAAAAAAAAAAAAHAQEBAAAAAAAAAAAAAAAAAAAAA//aAAwDAQACEAMQAAAAsIpMD//EABQQAQAAAAAAAAAAAAAAAAAAABD/2gAIAQEAAT8Af//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQIBAT8AP//EABQRAQAAAAAAAAAAAAAAAAAAABD/2gAIAQMBAT8AP//Z","aspectRatio":1015,"src":"https://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&fm=jpg","srcSet":"https://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=0.08&fm=jpg&w=2030 150w,\nhttps://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=0.15&fm=jpg&w=2030 300w,\nhttps://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=0.3&fm=jpg&w=2030 600w,\nhttps://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=0.45&fm=jpg&w=2030 900w,\nhttps://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=0.6&fm=jpg&w=2030 1200w,\nhttps://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=0.89&fm=jpg&w=2030 1800w,\nhttps://www.datocms-assets.com/28985/1603898463-screenshot-2020-10-28-at-15-20-38.png?auto=compress%2Cformat&dpr=1&fm=jpg&w=2030 2030w","sizes":"(max-width: 600px) 100vw, 600px"}}}},"pageContext":{"slug":"installing-tensorflow-on-m1-with-pyenv"}}}